zhihao-ui 1.2.32 → 1.2.33

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.
@@ -50,7 +50,7 @@ var hookCallback;function hooks(){return hookCallback.apply(null,arguments)}func
50
50
  [`+g+"] ";for(y in arguments[0])hasOwnProp(arguments[0],y)&&(i+=y+": "+arguments[0][y]+", ");i=i.slice(0,-2)}else i=arguments[g];r.push(i)}warn$1(t+`
51
51
  Arguments: `+Array.prototype.slice.call(r).join("")+`
52
52
  `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var deprecations={};function deprecateSimple(t,e){hooks.deprecationHandler!=null&&hooks.deprecationHandler(t,e),deprecations[t]||(warn$1(e),deprecations[t]=!0)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null;function isFunction(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function set$1(t){var e,n;for(n in t)hasOwnProp(t,n)&&(e=t[n],isFunction(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(t,e){var n=extend$4({},t),r;for(r in e)hasOwnProp(e,r)&&(isObject(t[r])&&isObject(e[r])?(n[r]={},extend$4(n[r],t[r]),extend$4(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)hasOwnProp(t,r)&&!hasOwnProp(e,r)&&isObject(t[r])&&(n[r]=extend$4({},n[r]));return n}function Locale(t){t!=null&&this.set(t)}var keys;Object.keys?keys=Object.keys:keys=function(t){var e,n=[];for(e in t)hasOwnProp(t,e)&&n.push(e);return n};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return isFunction(r)?r.call(e,n):r}function zeroFill(t,e,n){var r=""+Math.abs(t),i=e-r.length,g=t>=0;return(g?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(formatTokenFunctions[t]=i),e&&(formatTokenFunctions[e[0]]=function(){return zeroFill(i.apply(this,arguments),e[1],e[2])}),n&&(formatTokenFunctions[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function removeFormattingTokens(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function makeFormatFunction(t){var e=t.match(formattingTokens),n,r;for(n=0,r=e.length;n<r;n++)formatTokenFunctions[e[n]]?e[n]=formatTokenFunctions[e[n]]:e[n]=removeFormattingTokens(e[n]);return function(i){var g="",y;for(y=0;y<r;y++)g+=isFunction(e[y])?e[y].call(i,t):e[y];return g}}function formatMoment(t,e){return t.isValid()?(e=expandFormat(e,t.localeData()),formatFunctions[e]=formatFunctions[e]||makeFormatFunction(e),formatFunctions[e](t)):t.localeData().invalidDate()}function expandFormat(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(localFormattingTokens.lastIndex=0;n>=0&&localFormattingTokens.test(t);)t=t.replace(localFormattingTokens,r),localFormattingTokens.lastIndex=0,n-=1;return t}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(formattingTokens).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var defaultInvalidDate="Invalid date";function invalidDate(){return this._invalidDate}var defaultOrdinal="%d",defaultDayOfMonthOrdinalParse=/\d{1,2}/;function ordinal(t){return this._ordinal.replace("%d",t)}var defaultRelativeTime={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function relativeTime(t,e,n,r){var i=this._relativeTime[n];return isFunction(i)?i(t,e,n,r):i.replace(/%d/i,t)}function pastFuture(t,e){var n=this._relativeTime[t>0?"future":"past"];return isFunction(n)?n(e):n.replace(/%s/i,e)}var aliases={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function normalizeUnits(t){return typeof t=="string"?aliases[t]||aliases[t.toLowerCase()]:void 0}function normalizeObjectUnits(t){var e={},n,r;for(r in t)hasOwnProp(t,r)&&(n=normalizeUnits(r),n&&(e[n]=t[r]));return e}var priorities={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function getPrioritizedUnits(t){var e=[],n;for(n in t)hasOwnProp(t,n)&&e.push({unit:n,priority:priorities[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var match1=/\d/,match2=/\d\d/,match3=/\d{3}/,match4=/\d{4}/,match6=/[+-]?\d{6}/,match1to2=/\d\d?/,match3to4=/\d\d\d\d?/,match5to6=/\d\d\d\d\d\d?/,match1to3=/\d{1,3}/,match1to4=/\d{1,4}/,match1to6=/[+-]?\d{1,6}/,matchUnsigned=/\d+/,matchSigned=/[+-]?\d+/,matchOffset=/Z|[+-]\d\d:?\d\d/gi,matchShortOffset=/Z|[+-]\d\d(?::?\d\d)?/gi,matchTimestamp=/[+-]?\d+(\.\d{1,3})?/,matchWord=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,match1to2NoLeadingZero=/^[1-9]\d?/,match1to2HasZero=/^([1-9]\d|\d)/,regexes;regexes={};function addRegexToken(t,e,n){regexes[t]=isFunction(e)?e:function(r,i){return r&&n?n:e}}function getParseRegexForToken(t,e){return hasOwnProp(regexes,t)?regexes[t](e._strict,e._locale):new RegExp(unescapeFormat(t))}function unescapeFormat(t){return regexEscape(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,g){return n||r||i||g}))}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function absFloor(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function toInt(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=absFloor(e)),n}var tokens={};function addParseToken(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),isNumber(e)&&(r=function(g,y){y[e]=toInt(g)}),i=t.length,n=0;n<i;n++)tokens[t[n]]=r}function addWeekParseToken(t,e){addParseToken(t,function(n,r,i,g){i._w=i._w||{},e(n,i._w,i,g)})}function addTimeToArrayFromToken(t,e,n){e!=null&&hasOwnProp(tokens,t)&&tokens[t](e,n._a,n,t)}function isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}var YEAR=0,MONTH=1,DATE=2,HOUR=3,MINUTE=4,SECOND=5,MILLISECOND=6,WEEK=7,WEEKDAY=8;addFormatToken("Y",0,0,function(){var t=this.year();return t<=9999?zeroFill(t,4):"+"+t}),addFormatToken(0,["YY",2],0,function(){return this.year()%100}),addFormatToken(0,["YYYY",4],0,"year"),addFormatToken(0,["YYYYY",5],0,"year"),addFormatToken(0,["YYYYYY",6,!0],0,"year"),addRegexToken("Y",matchSigned),addRegexToken("YY",match1to2,match2),addRegexToken("YYYY",match1to4,match4),addRegexToken("YYYYY",match1to6,match6),addRegexToken("YYYYYY",match1to6,match6),addParseToken(["YYYYY","YYYYYY"],YEAR),addParseToken("YYYY",function(t,e){e[YEAR]=t.length===2?hooks.parseTwoDigitYear(t):toInt(t)}),addParseToken("YY",function(t,e){e[YEAR]=hooks.parseTwoDigitYear(t)}),addParseToken("Y",function(t,e){e[YEAR]=parseInt(t,10)});function daysInYear(t){return isLeapYear(t)?366:365}hooks.parseTwoDigitYear=function(t){return toInt(t)+(toInt(t)>68?1900:2e3)};var getSetYear=makeGetSet("FullYear",!0);function getIsLeapYear(){return isLeapYear(this.year())}function makeGetSet(t,e){return function(n){return n!=null?(set$1$1(this,t,n),hooks.updateOffset(this,e),this):get$4(this,t)}}function get$4(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function set$1$1(t,e,n){var r,i,g,y,k;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}g=n,y=t.month(),k=t.date(),k=k===29&&y===1&&!isLeapYear(g)?28:k,i?r.setUTCFullYear(g,y,k):r.setFullYear(g,y,k)}}function stringGet(t){return t=normalizeUnits(t),isFunction(this[t])?this[t]():this}function stringSet(t,e){if(typeof t=="object"){t=normalizeObjectUnits(t);var n=getPrioritizedUnits(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=normalizeUnits(t),isFunction(this[t]))return this[t](e);return this}function mod(t,e){return(t%e+e)%e}var indexOf;Array.prototype.indexOf?indexOf=Array.prototype.indexOf:indexOf=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function daysInMonth(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=mod(e,12);return t+=(e-n)/12,n===1?isLeapYear(t)?29:28:31-n%7%2}addFormatToken("M",["MM",2],"Mo",function(){return this.month()+1}),addFormatToken("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),addFormatToken("MMMM",0,0,function(t){return this.localeData().months(this,t)}),addRegexToken("M",match1to2,match1to2NoLeadingZero),addRegexToken("MM",match1to2,match2),addRegexToken("MMM",function(t,e){return e.monthsShortRegex(t)}),addRegexToken("MMMM",function(t,e){return e.monthsRegex(t)}),addParseToken(["M","MM"],function(t,e){e[MONTH]=toInt(t)-1}),addParseToken(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[MONTH]=i:getParsingFlags(n).invalidMonth=t});var defaultLocaleMonths="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),defaultLocaleMonthsShort="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),MONTHS_IN_FORMAT=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,defaultMonthsShortRegex=matchWord,defaultMonthsRegex=matchWord;function localeMonths(t,e){return t?isArray(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||MONTHS_IN_FORMAT).test(e)?"format":"standalone"][t.month()]:isArray(this._months)?this._months:this._months.standalone}function localeMonthsShort(t,e){return t?isArray(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[MONTHS_IN_FORMAT.test(e)?"format":"standalone"][t.month()]:isArray(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function handleStrictParse(t,e,n){var r,i,g,y=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)g=createUTC([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(g,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(g,"").toLocaleLowerCase();return n?e==="MMM"?(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:null):(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:null):e==="MMM"?(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:null)):(i=indexOf.call(this._longMonthsParse,y),i!==-1?i:(i=indexOf.call(this._shortMonthsParse,y),i!==-1?i:null))}function localeMonthsParse(t,e,n){var r,i,g;if(this._monthsParseExact)return handleStrictParse.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=createUTC([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(g="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(g.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function setMonth(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=toInt(e);else if(e=t.localeData().monthsParse(e),!isNumber(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,daysInMonth(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function getSetMonth(t){return t!=null?(setMonth(this,t),hooks.updateOffset(this,!0),this):get$4(this,"Month")}function getDaysInMonth(){return daysInMonth(this.year(),this.month())}function monthsShortRegex(t){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(hasOwnProp(this,"_monthsShortRegex")||(this._monthsShortRegex=defaultMonthsShortRegex),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function monthsRegex(t){return this._monthsParseExact?(hasOwnProp(this,"_monthsRegex")||computeMonthsParse.call(this),t?this._monthsStrictRegex:this._monthsRegex):(hasOwnProp(this,"_monthsRegex")||(this._monthsRegex=defaultMonthsRegex),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function computeMonthsParse(){function t(L,$){return $.length-L.length}var e=[],n=[],r=[],i,g,y,k;for(i=0;i<12;i++)g=createUTC([2e3,i]),y=regexEscape(this.monthsShort(g,"")),k=regexEscape(this.months(g,"")),e.push(y),n.push(k),r.push(k),r.push(y);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function createDate(t,e,n,r,i,g,y){var k;return t<100&&t>=0?(k=new Date(t+400,e,n,r,i,g,y),isFinite(k.getFullYear())&&k.setFullYear(t)):k=new Date(t,e,n,r,i,g,y),k}function createUTCDate(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function firstWeekOffset(t,e,n){var r=7+e-n,i=(7+createUTCDate(t,0,r).getUTCDay()-e)%7;return-i+r-1}function dayOfYearFromWeeks(t,e,n,r,i){var g=(7+n-r)%7,y=firstWeekOffset(t,r,i),k=1+7*(e-1)+g+y,L,$;return k<=0?(L=t-1,$=daysInYear(L)+k):k>daysInYear(t)?(L=t+1,$=k-daysInYear(t)):(L=t,$=k),{year:L,dayOfYear:$}}function weekOfYear(t,e,n){var r=firstWeekOffset(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,g,y;return i<1?(y=t.year()-1,g=i+weeksInYear(y,e,n)):i>weeksInYear(t.year(),e,n)?(g=i-weeksInYear(t.year(),e,n),y=t.year()+1):(y=t.year(),g=i),{week:g,year:y}}function weeksInYear(t,e,n){var r=firstWeekOffset(t,e,n),i=firstWeekOffset(t+1,e,n);return(daysInYear(t)-r+i)/7}addFormatToken("w",["ww",2],"wo","week"),addFormatToken("W",["WW",2],"Wo","isoWeek"),addRegexToken("w",match1to2,match1to2NoLeadingZero),addRegexToken("ww",match1to2,match2),addRegexToken("W",match1to2,match1to2NoLeadingZero),addRegexToken("WW",match1to2,match2),addWeekParseToken(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=toInt(t)});function localeWeek(t){return weekOfYear(t,this._week.dow,this._week.doy).week}var defaultLocaleWeek={dow:0,doy:6};function localeFirstDayOfWeek(){return this._week.dow}function localeFirstDayOfYear(){return this._week.doy}function getSetWeek(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function getSetISOWeek(t){var e=weekOfYear(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}addFormatToken("d",0,"do","day"),addFormatToken("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),addFormatToken("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),addFormatToken("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),addFormatToken("e",0,0,"weekday"),addFormatToken("E",0,0,"isoWeekday"),addRegexToken("d",match1to2),addRegexToken("e",match1to2),addRegexToken("E",match1to2),addRegexToken("dd",function(t,e){return e.weekdaysMinRegex(t)}),addRegexToken("ddd",function(t,e){return e.weekdaysShortRegex(t)}),addRegexToken("dddd",function(t,e){return e.weekdaysRegex(t)}),addWeekParseToken(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:getParsingFlags(n).invalidWeekday=t}),addWeekParseToken(["d","e","E"],function(t,e,n,r){e[r]=toInt(t)});function parseWeekday(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function parseIsoWeekday(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function shiftWeekdays(t,e){return t.slice(e,7).concat(t.slice(0,e))}var defaultLocaleWeekdays="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),defaultLocaleWeekdaysShort="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),defaultLocaleWeekdaysMin="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),defaultWeekdaysRegex=matchWord,defaultWeekdaysShortRegex=matchWord,defaultWeekdaysMinRegex=matchWord;function localeWeekdays(t,e){var n=isArray(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?shiftWeekdays(n,this._week.dow):t?n[t.day()]:n}function localeWeekdaysShort(t){return t===!0?shiftWeekdays(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function localeWeekdaysMin(t){return t===!0?shiftWeekdays(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function handleStrictParse$1(t,e,n){var r,i,g,y=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)g=createUTC([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(g,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(g,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(g,"").toLocaleLowerCase();return n?e==="dddd"?(i=indexOf.call(this._weekdaysParse,y),i!==-1?i:null):e==="ddd"?(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1?i:null):(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null):e==="dddd"?(i=indexOf.call(this._weekdaysParse,y),i!==-1||(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null)):e==="ddd"?(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1||(i=indexOf.call(this._weekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._minWeekdaysParse,y),i!==-1?i:null)):(i=indexOf.call(this._minWeekdaysParse,y),i!==-1||(i=indexOf.call(this._weekdaysParse,y),i!==-1)?i:(i=indexOf.call(this._shortWeekdaysParse,y),i!==-1?i:null))}function localeWeekdaysParse(t,e,n){var r,i,g;if(this._weekdaysParseExact)return handleStrictParse$1.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=createUTC([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(g="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(g.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function getSetDayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;var e=get$4(this,"Day");return t!=null?(t=parseWeekday(t,this.localeData()),this.add(t-e,"d")):e}function getSetLocaleDayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function getSetISODayOfWeek(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=parseIsoWeekday(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function weekdaysRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(hasOwnProp(this,"_weekdaysRegex")||(this._weekdaysRegex=defaultWeekdaysRegex),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function weekdaysShortRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(hasOwnProp(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=defaultWeekdaysShortRegex),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function weekdaysMinRegex(t){return this._weekdaysParseExact?(hasOwnProp(this,"_weekdaysRegex")||computeWeekdaysParse.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(hasOwnProp(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=defaultWeekdaysMinRegex),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function computeWeekdaysParse(){function t(V,z){return z.length-V.length}var e=[],n=[],r=[],i=[],g,y,k,L,$;for(g=0;g<7;g++)y=createUTC([2e3,1]).day(g),k=regexEscape(this.weekdaysMin(y,"")),L=regexEscape(this.weekdaysShort(y,"")),$=regexEscape(this.weekdays(y,"")),e.push(k),n.push(L),r.push($),i.push(k),i.push(L),i.push($);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function hFormat(){return this.hours()%12||12}function kFormat(){return this.hours()||24}addFormatToken("H",["HH",2],0,"hour"),addFormatToken("h",["hh",2],0,hFormat),addFormatToken("k",["kk",2],0,kFormat),addFormatToken("hmm",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)}),addFormatToken("hmmss",0,0,function(){return""+hFormat.apply(this)+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)}),addFormatToken("Hmm",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)}),addFormatToken("Hmmss",0,0,function(){return""+this.hours()+zeroFill(this.minutes(),2)+zeroFill(this.seconds(),2)});function meridiem(t,e){addFormatToken(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}meridiem("a",!0),meridiem("A",!1);function matchMeridiem(t,e){return e._meridiemParse}addRegexToken("a",matchMeridiem),addRegexToken("A",matchMeridiem),addRegexToken("H",match1to2,match1to2HasZero),addRegexToken("h",match1to2,match1to2NoLeadingZero),addRegexToken("k",match1to2,match1to2NoLeadingZero),addRegexToken("HH",match1to2,match2),addRegexToken("hh",match1to2,match2),addRegexToken("kk",match1to2,match2),addRegexToken("hmm",match3to4),addRegexToken("hmmss",match5to6),addRegexToken("Hmm",match3to4),addRegexToken("Hmmss",match5to6),addParseToken(["H","HH"],HOUR),addParseToken(["k","kk"],function(t,e,n){var r=toInt(t);e[HOUR]=r===24?0:r}),addParseToken(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),addParseToken(["h","hh"],function(t,e,n){e[HOUR]=toInt(t),getParsingFlags(n).bigHour=!0}),addParseToken("hmm",function(t,e,n){var r=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r)),getParsingFlags(n).bigHour=!0}),addParseToken("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r,2)),e[SECOND]=toInt(t.substr(i)),getParsingFlags(n).bigHour=!0}),addParseToken("Hmm",function(t,e,n){var r=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r))}),addParseToken("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[HOUR]=toInt(t.substr(0,r)),e[MINUTE]=toInt(t.substr(r,2)),e[SECOND]=toInt(t.substr(i))});function localeIsPM(t){return(t+"").toLowerCase().charAt(0)==="p"}var defaultLocaleMeridiemParse=/[ap]\.?m?\.?/i,getSetHour=makeGetSet("Hours",!0);function localeMeridiem(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var baseConfig={calendar:defaultCalendar,longDateFormat:defaultLongDateFormat,invalidDate:defaultInvalidDate,ordinal:defaultOrdinal,dayOfMonthOrdinalParse:defaultDayOfMonthOrdinalParse,relativeTime:defaultRelativeTime,months:defaultLocaleMonths,monthsShort:defaultLocaleMonthsShort,week:defaultLocaleWeek,weekdays:defaultLocaleWeekdays,weekdaysMin:defaultLocaleWeekdaysMin,weekdaysShort:defaultLocaleWeekdaysShort,meridiemParse:defaultLocaleMeridiemParse},locales={},localeFamilies={},globalLocale;function commonPrefix(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function normalizeLocale(t){return t&&t.toLowerCase().replace("_","-")}function chooseLocale(t){for(var e=0,n,r,i,g;e<t.length;){for(g=normalizeLocale(t[e]).split("-"),n=g.length,r=normalizeLocale(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=loadLocale(g.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&commonPrefix(g,r)>=n-1)break;n--}e++}return globalLocale}function isLocaleNameSane(t){return!!(t&&t.match("^[^/\\\\]*$"))}function loadLocale(t){var e=null,n;if(locales[t]===void 0&&typeof module<"u"&&module&&module.exports&&isLocaleNameSane(t))try{e=globalLocale._abbr,n=require,n("./locale/"+t),getSetGlobalLocale(e)}catch{locales[t]=null}return locales[t]}function getSetGlobalLocale(t,e){var n;return t&&(isUndefined(e)?n=getLocale(t):n=defineLocale(t,e),n?globalLocale=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),globalLocale._abbr}function defineLocale(t,e){if(e!==null){var n,r=baseConfig;if(e.abbr=t,locales[t]!=null)deprecateSimple("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=locales[t]._config;else if(e.parentLocale!=null)if(locales[e.parentLocale]!=null)r=locales[e.parentLocale]._config;else if(n=loadLocale(e.parentLocale),n!=null)r=n._config;else return localeFamilies[e.parentLocale]||(localeFamilies[e.parentLocale]=[]),localeFamilies[e.parentLocale].push({name:t,config:e}),null;return locales[t]=new Locale(mergeConfigs(r,e)),localeFamilies[t]&&localeFamilies[t].forEach(function(i){defineLocale(i.name,i.config)}),getSetGlobalLocale(t),locales[t]}else return delete locales[t],null}function updateLocale(t,e){if(e!=null){var n,r,i=baseConfig;locales[t]!=null&&locales[t].parentLocale!=null?locales[t].set(mergeConfigs(locales[t]._config,e)):(r=loadLocale(t),r!=null&&(i=r._config),e=mergeConfigs(i,e),r==null&&(e.abbr=t),n=new Locale(e),n.parentLocale=locales[t],locales[t]=n),getSetGlobalLocale(t)}else locales[t]!=null&&(locales[t].parentLocale!=null?(locales[t]=locales[t].parentLocale,t===getSetGlobalLocale()&&getSetGlobalLocale(t)):locales[t]!=null&&delete locales[t]);return locales[t]}function getLocale(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return globalLocale;if(!isArray(t)){if(e=loadLocale(t),e)return e;t=[t]}return chooseLocale(t)}function listLocales(){return keys(locales)}function checkOverflow(t){var e,n=t._a;return n&&getParsingFlags(t).overflow===-2&&(e=n[MONTH]<0||n[MONTH]>11?MONTH:n[DATE]<1||n[DATE]>daysInMonth(n[YEAR],n[MONTH])?DATE:n[HOUR]<0||n[HOUR]>24||n[HOUR]===24&&(n[MINUTE]!==0||n[SECOND]!==0||n[MILLISECOND]!==0)?HOUR:n[MINUTE]<0||n[MINUTE]>59?MINUTE:n[SECOND]<0||n[SECOND]>59?SECOND:n[MILLISECOND]<0||n[MILLISECOND]>999?MILLISECOND:-1,getParsingFlags(t)._overflowDayOfYear&&(e<YEAR||e>DATE)&&(e=DATE),getParsingFlags(t)._overflowWeeks&&e===-1&&(e=WEEK),getParsingFlags(t)._overflowWeekday&&e===-1&&(e=WEEKDAY),getParsingFlags(t).overflow=e),t}var extendedIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,basicIsoRegex=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,tzRegex=/Z|[+-]\d\d(?::?\d\d)?/,isoDates=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],isoTimes=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],aspNetJsonRegex=/^\/?Date\((-?\d+)/i,rfc2822=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,obsOffsets={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function configFromISO(t){var e,n,r=t._i,i=extendedIsoRegex.exec(r)||basicIsoRegex.exec(r),g,y,k,L,$=isoDates.length,V=isoTimes.length;if(i){for(getParsingFlags(t).iso=!0,e=0,n=$;e<n;e++)if(isoDates[e][1].exec(i[1])){y=isoDates[e][0],g=isoDates[e][2]!==!1;break}if(y==null){t._isValid=!1;return}if(i[3]){for(e=0,n=V;e<n;e++)if(isoTimes[e][1].exec(i[3])){k=(i[2]||" ")+isoTimes[e][0];break}if(k==null){t._isValid=!1;return}}if(!g&&k!=null){t._isValid=!1;return}if(i[4])if(tzRegex.exec(i[4]))L="Z";else{t._isValid=!1;return}t._f=y+(k||"")+(L||""),configFromStringAndFormat(t)}else t._isValid=!1}function extractFromRFC2822Strings(t,e,n,r,i,g){var y=[untruncateYear(t),defaultLocaleMonthsShort.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return g&&y.push(parseInt(g,10)),y}function untruncateYear(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function preprocessRFC2822(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function checkWeekday(t,e,n){if(t){var r=defaultLocaleWeekdaysShort.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return getParsingFlags(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function calculateOffset(t,e,n){if(t)return obsOffsets[t];if(e)return 0;var r=parseInt(n,10),i=r%100,g=(r-i)/100;return g*60+i}function configFromRFC2822(t){var e=rfc2822.exec(preprocessRFC2822(t._i)),n;if(e){if(n=extractFromRFC2822Strings(e[4],e[3],e[2],e[5],e[6],e[7]),!checkWeekday(e[1],n,t))return;t._a=n,t._tzm=calculateOffset(e[8],e[9],e[10]),t._d=createUTCDate.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),getParsingFlags(t).rfc2822=!0}else t._isValid=!1}function configFromString(t){var e=aspNetJsonRegex.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(configFromISO(t),t._isValid===!1)delete t._isValid;else return;if(configFromRFC2822(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:hooks.createFromInputFallback(t)}hooks.createFromInputFallback=deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function defaults$3(t,e,n){return t??e??n}function currentDateArray(t){var e=new Date(hooks.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function configFromArray(t){var e,n,r=[],i,g,y;if(!t._d){for(i=currentDateArray(t),t._w&&t._a[DATE]==null&&t._a[MONTH]==null&&dayOfYearFromWeekInfo(t),t._dayOfYear!=null&&(y=defaults$3(t._a[YEAR],i[YEAR]),(t._dayOfYear>daysInYear(y)||t._dayOfYear===0)&&(getParsingFlags(t)._overflowDayOfYear=!0),n=createUTCDate(y,0,t._dayOfYear),t._a[MONTH]=n.getUTCMonth(),t._a[DATE]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[HOUR]===24&&t._a[MINUTE]===0&&t._a[SECOND]===0&&t._a[MILLISECOND]===0&&(t._nextDay=!0,t._a[HOUR]=0),t._d=(t._useUTC?createUTCDate:createDate).apply(null,r),g=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[HOUR]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==g&&(getParsingFlags(t).weekdayMismatch=!0)}}function dayOfYearFromWeekInfo(t){var e,n,r,i,g,y,k,L,$;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(g=1,y=4,n=defaults$3(e.GG,t._a[YEAR],weekOfYear(createLocal(),1,4).year),r=defaults$3(e.W,1),i=defaults$3(e.E,1),(i<1||i>7)&&(L=!0)):(g=t._locale._week.dow,y=t._locale._week.doy,$=weekOfYear(createLocal(),g,y),n=defaults$3(e.gg,t._a[YEAR],$.year),r=defaults$3(e.w,$.week),e.d!=null?(i=e.d,(i<0||i>6)&&(L=!0)):e.e!=null?(i=e.e+g,(e.e<0||e.e>6)&&(L=!0)):i=g),r<1||r>weeksInYear(n,g,y)?getParsingFlags(t)._overflowWeeks=!0:L!=null?getParsingFlags(t)._overflowWeekday=!0:(k=dayOfYearFromWeeks(n,r,i,g,y),t._a[YEAR]=k.year,t._dayOfYear=k.dayOfYear)}hooks.ISO_8601=function(){},hooks.RFC_2822=function(){};function configFromStringAndFormat(t){if(t._f===hooks.ISO_8601){configFromISO(t);return}if(t._f===hooks.RFC_2822){configFromRFC2822(t);return}t._a=[],getParsingFlags(t).empty=!0;var e=""+t._i,n,r,i,g,y,k=e.length,L=0,$,V;for(i=expandFormat(t._f,t._locale).match(formattingTokens)||[],V=i.length,n=0;n<V;n++)g=i[n],r=(e.match(getParseRegexForToken(g,t))||[])[0],r&&(y=e.substr(0,e.indexOf(r)),y.length>0&&getParsingFlags(t).unusedInput.push(y),e=e.slice(e.indexOf(r)+r.length),L+=r.length),formatTokenFunctions[g]?(r?getParsingFlags(t).empty=!1:getParsingFlags(t).unusedTokens.push(g),addTimeToArrayFromToken(g,r,t)):t._strict&&!r&&getParsingFlags(t).unusedTokens.push(g);getParsingFlags(t).charsLeftOver=k-L,e.length>0&&getParsingFlags(t).unusedInput.push(e),t._a[HOUR]<=12&&getParsingFlags(t).bigHour===!0&&t._a[HOUR]>0&&(getParsingFlags(t).bigHour=void 0),getParsingFlags(t).parsedDateParts=t._a.slice(0),getParsingFlags(t).meridiem=t._meridiem,t._a[HOUR]=meridiemFixWrap(t._locale,t._a[HOUR],t._meridiem),$=getParsingFlags(t).era,$!==null&&(t._a[YEAR]=t._locale.erasConvertYear($,t._a[YEAR])),configFromArray(t),checkOverflow(t)}function meridiemFixWrap(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function configFromStringAndArray(t){var e,n,r,i,g,y,k=!1,L=t._f.length;if(L===0){getParsingFlags(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<L;i++)g=0,y=!1,e=copyConfig({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],configFromStringAndFormat(e),isValid(e)&&(y=!0),g+=getParsingFlags(e).charsLeftOver,g+=getParsingFlags(e).unusedTokens.length*10,getParsingFlags(e).score=g,k?g<r&&(r=g,n=e):(r==null||g<r||y)&&(r=g,n=e,y&&(k=!0));extend$4(t,n||e)}function configFromObject(t){if(!t._d){var e=normalizeObjectUnits(t._i),n=e.day===void 0?e.date:e.day;t._a=map([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),configFromArray(t)}}function createFromConfig(t){var e=new Moment(checkOverflow(prepareConfig(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function prepareConfig(t){var e=t._i,n=t._f;return t._locale=t._locale||getLocale(t._l),e===null||n===void 0&&e===""?createInvalid({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),isMoment(e)?new Moment(checkOverflow(e)):(isDate(e)?t._d=e:isArray(n)?configFromStringAndArray(t):n?configFromStringAndFormat(t):configFromInput(t),isValid(t)||(t._d=null),t))}function configFromInput(t){var e=t._i;isUndefined(e)?t._d=new Date(hooks.now()):isDate(e)?t._d=new Date(e.valueOf()):typeof e=="string"?configFromString(t):isArray(e)?(t._a=map(e.slice(0),function(n){return parseInt(n,10)}),configFromArray(t)):isObject(e)?configFromObject(t):isNumber(e)?t._d=new Date(e):hooks.createFromInputFallback(t)}function createLocalOrUTC(t,e,n,r,i){var g={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(isObject(t)&&isObjectEmpty(t)||isArray(t)&&t.length===0)&&(t=void 0),g._isAMomentObject=!0,g._useUTC=g._isUTC=i,g._l=n,g._i=t,g._f=e,g._strict=r,createFromConfig(g)}function createLocal(t,e,n,r){return createLocalOrUTC(t,e,n,r,!1)}var prototypeMin=deprecate("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:createInvalid()}),prototypeMax=deprecate("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=createLocal.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:createInvalid()});function pickBy(t,e){var n,r;if(e.length===1&&isArray(e[0])&&(e=e[0]),!e.length)return createLocal();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function min(){var t=[].slice.call(arguments,0);return pickBy("isBefore",t)}function max(){var t=[].slice.call(arguments,0);return pickBy("isAfter",t)}var now=function(){return Date.now?Date.now():+new Date},ordering=["year","quarter","month","week","day","hour","minute","second","millisecond"];function isDurationValid(t){var e,n=!1,r,i=ordering.length;for(e in t)if(hasOwnProp(t,e)&&!(indexOf.call(ordering,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[ordering[r]]){if(n)return!1;parseFloat(t[ordering[r]])!==toInt(t[ordering[r]])&&(n=!0)}return!0}function isValid$1(){return this._isValid}function createInvalid$1(){return createDuration(NaN)}function Duration(t){var e=normalizeObjectUnits(t),n=e.year||0,r=e.quarter||0,i=e.month||0,g=e.week||e.isoWeek||0,y=e.day||0,k=e.hour||0,L=e.minute||0,$=e.second||0,V=e.millisecond||0;this._isValid=isDurationValid(e),this._milliseconds=+V+$*1e3+L*6e4+k*1e3*60*60,this._days=+y+g*7,this._months=+i+r*3+n*12,this._data={},this._locale=getLocale(),this._bubble()}function isDuration(t){return t instanceof Duration}function absRound(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function compareArrays(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),g=0,y;for(y=0;y<r;y++)toInt(t[y])!==toInt(e[y])&&g++;return g+i}function offset(t,e){addFormatToken(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+zeroFill(~~(n/60),2)+e+zeroFill(~~n%60,2)})}offset("Z",":"),offset("ZZ",""),addRegexToken("Z",matchShortOffset),addRegexToken("ZZ",matchShortOffset),addParseToken(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=offsetFromString(matchShortOffset,t)});var chunkOffset=/([\+\-]|\d\d)/gi;function offsetFromString(t,e){var n=(e||"").match(t),r,i,g;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(chunkOffset)||["-",0,0],g=+(i[1]*60)+toInt(i[2]),g===0?0:i[0]==="+"?g:-g)}function cloneWithOffset(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(isMoment(t)||isDate(t)?t.valueOf():createLocal(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),hooks.updateOffset(n,!1),n):createLocal(t).local()}function getDateOffset(t){return-Math.round(t._d.getTimezoneOffset())}hooks.updateOffset=function(){};function getSetOffset(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=offsetFromString(matchShortOffset,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=getDateOffset(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?addSubtract(this,createDuration(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,hooks.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:getDateOffset(this)}function getSetZone(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function setOffsetToUTC(t){return this.utcOffset(0,t)}function setOffsetToLocal(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(getDateOffset(this),"m")),this}function setOffsetToParsedOffset(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=offsetFromString(matchOffset,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function hasAlignedHourOffset(t){return this.isValid()?(t=t?createLocal(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function isDaylightSavingTime(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function isDaylightSavingTimeShifted(){if(!isUndefined(this._isDSTShifted))return this._isDSTShifted;var t={},e;return copyConfig(t,this),t=prepareConfig(t),t._a?(e=t._isUTC?createUTC(t._a):createLocal(t._a),this._isDSTShifted=this.isValid()&&compareArrays(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function isLocal(){return this.isValid()?!this._isUTC:!1}function isUtcOffset(){return this.isValid()?this._isUTC:!1}function isUtc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var aspNetRegex=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,isoRegex=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function createDuration(t,e){var n=t,r=null,i,g,y;return isDuration(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:isNumber(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=aspNetRegex.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:toInt(r[DATE])*i,h:toInt(r[HOUR])*i,m:toInt(r[MINUTE])*i,s:toInt(r[SECOND])*i,ms:toInt(absRound(r[MILLISECOND]*1e3))*i}):(r=isoRegex.exec(t))?(i=r[1]==="-"?-1:1,n={y:parseIso(r[2],i),M:parseIso(r[3],i),w:parseIso(r[4],i),d:parseIso(r[5],i),h:parseIso(r[6],i),m:parseIso(r[7],i),s:parseIso(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(y=momentsDifference(createLocal(n.from),createLocal(n.to)),n={},n.ms=y.milliseconds,n.M=y.months),g=new Duration(n),isDuration(t)&&hasOwnProp(t,"_locale")&&(g._locale=t._locale),isDuration(t)&&hasOwnProp(t,"_isValid")&&(g._isValid=t._isValid),g}createDuration.fn=Duration.prototype,createDuration.invalid=createInvalid$1;function parseIso(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function positiveMomentsDifference(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function momentsDifference(t,e){var n;return t.isValid()&&e.isValid()?(e=cloneWithOffset(e,t),t.isBefore(e)?n=positiveMomentsDifference(t,e):(n=positiveMomentsDifference(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function createAdder(t,e){return function(n,r){var i,g;return r!==null&&!isNaN(+r)&&(deprecateSimple(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),g=n,n=r,r=g),i=createDuration(n,r),addSubtract(this,i,t),this}}function addSubtract(t,e,n,r){var i=e._milliseconds,g=absRound(e._days),y=absRound(e._months);t.isValid()&&(r=r??!0,y&&setMonth(t,get$4(t,"Month")+y*n),g&&set$1$1(t,"Date",get$4(t,"Date")+g*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&hooks.updateOffset(t,g||y))}var add$3=createAdder(1,"add"),subtract=createAdder(-1,"subtract");function isString(t){return typeof t=="string"||t instanceof String}function isMomentInput(t){return isMoment(t)||isDate(t)||isString(t)||isNumber(t)||isNumberOrStringArray(t)||isMomentInputObject(t)||t===null||t===void 0}function isMomentInputObject(t){var e=isObject(t)&&!isObjectEmpty(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,g,y=r.length;for(i=0;i<y;i+=1)g=r[i],n=n||hasOwnProp(t,g);return e&&n}function isNumberOrStringArray(t){var e=isArray(t),n=!1;return e&&(n=t.filter(function(r){return!isNumber(r)&&isString(t)}).length===0),e&&n}function isCalendarSpec(t){var e=isObject(t)&&!isObjectEmpty(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,g;for(i=0;i<r.length;i+=1)g=r[i],n=n||hasOwnProp(t,g);return e&&n}function getCalendarFormat(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function calendar$1(t,e){arguments.length===1&&(arguments[0]?isMomentInput(arguments[0])?(t=arguments[0],e=void 0):isCalendarSpec(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||createLocal(),r=cloneWithOffset(n,this).startOf("day"),i=hooks.calendarFormat(this,r)||"sameElse",g=e&&(isFunction(e[i])?e[i].call(this,n):e[i]);return this.format(g||this.localeData().calendar(i,this,createLocal(n)))}function clone$2(){return new Moment(this)}function isAfter(t,e){var n=isMoment(t)?t:createLocal(t);return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function isBefore(t,e){var n=isMoment(t)?t:createLocal(t);return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function isBetween(t,e,n,r){var i=isMoment(t)?t:createLocal(t),g=isMoment(e)?e:createLocal(e);return this.isValid()&&i.isValid()&&g.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(g,n):!this.isAfter(g,n))):!1}function isSame(t,e){var n=isMoment(t)?t:createLocal(t),r;return this.isValid()&&n.isValid()?(e=normalizeUnits(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function isSameOrAfter(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function isSameOrBefore(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function diff(t,e,n){var r,i,g;if(!this.isValid())return NaN;if(r=cloneWithOffset(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=normalizeUnits(e),e){case"year":g=monthDiff(this,r)/12;break;case"month":g=monthDiff(this,r);break;case"quarter":g=monthDiff(this,r)/3;break;case"second":g=(this-r)/1e3;break;case"minute":g=(this-r)/6e4;break;case"hour":g=(this-r)/36e5;break;case"day":g=(this-r-i)/864e5;break;case"week":g=(this-r-i)/6048e5;break;default:g=this-r}return n?g:absFloor(g)}function monthDiff(t,e){if(t.date()<e.date())return-monthDiff(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,g;return e-r<0?(i=t.clone().add(n-1,"months"),g=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),g=(e-r)/(i-r)),-(n+g)||0}hooks.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",hooks.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function toString$2(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function toISOString(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?formatMoment(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):isFunction(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",formatMoment(n,"Z")):formatMoment(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function inspect(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,g;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",g=e+'[")]',this.format(n+r+i+g)}function format(t){t||(t=this.isUtc()?hooks.defaultFormatUtc:hooks.defaultFormat);var e=formatMoment(this,t);return this.localeData().postformat(e)}function from(t,e){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function fromNow(t){return this.from(createLocal(),t)}function to(t,e){return this.isValid()&&(isMoment(t)&&t.isValid()||createLocal(t).isValid())?createDuration({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function toNow(t){return this.to(createLocal(),t)}function locale(t){var e;return t===void 0?this._locale._abbr:(e=getLocale(t),e!=null&&(this._locale=e),this)}var lang=deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function localeData(){return this._locale}var MS_PER_SECOND=1e3,MS_PER_MINUTE=60*MS_PER_SECOND,MS_PER_HOUR=60*MS_PER_MINUTE,MS_PER_400_YEARS=(365*400+97)*24*MS_PER_HOUR;function mod$1(t,e){return(t%e+e)%e}function localStartOfDate(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-MS_PER_400_YEARS:new Date(t,e,n).valueOf()}function utcStartOfDate(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-MS_PER_400_YEARS:Date.UTC(t,e,n)}function startOf(t){var e,n;if(t=normalizeUnits(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=mod$1(e+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR);break;case"minute":e=this._d.valueOf(),e-=mod$1(e,MS_PER_MINUTE);break;case"second":e=this._d.valueOf(),e-=mod$1(e,MS_PER_SECOND);break}return this._d.setTime(e),hooks.updateOffset(this,!0),this}function endOf(t){var e,n;if(t=normalizeUnits(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?utcStartOfDate:localStartOfDate,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=MS_PER_HOUR-mod$1(e+(this._isUTC?0:this.utcOffset()*MS_PER_MINUTE),MS_PER_HOUR)-1;break;case"minute":e=this._d.valueOf(),e+=MS_PER_MINUTE-mod$1(e,MS_PER_MINUTE)-1;break;case"second":e=this._d.valueOf(),e+=MS_PER_SECOND-mod$1(e,MS_PER_SECOND)-1;break}return this._d.setTime(e),hooks.updateOffset(this,!0),this}function valueOf(){return this._d.valueOf()-(this._offset||0)*6e4}function unix(){return Math.floor(this.valueOf()/1e3)}function toDate(){return new Date(this.valueOf())}function toArray$1(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function toObject(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function toJSON(){return this.isValid()?this.toISOString():null}function isValid$2(){return isValid(this)}function parsingFlags(){return extend$4({},getParsingFlags(this))}function invalidAt(){return getParsingFlags(this).overflow}function creationData(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}addFormatToken("N",0,0,"eraAbbr"),addFormatToken("NN",0,0,"eraAbbr"),addFormatToken("NNN",0,0,"eraAbbr"),addFormatToken("NNNN",0,0,"eraName"),addFormatToken("NNNNN",0,0,"eraNarrow"),addFormatToken("y",["y",1],"yo","eraYear"),addFormatToken("y",["yy",2],0,"eraYear"),addFormatToken("y",["yyy",3],0,"eraYear"),addFormatToken("y",["yyyy",4],0,"eraYear"),addRegexToken("N",matchEraAbbr),addRegexToken("NN",matchEraAbbr),addRegexToken("NNN",matchEraAbbr),addRegexToken("NNNN",matchEraName),addRegexToken("NNNNN",matchEraNarrow),addParseToken(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?getParsingFlags(n).era=i:getParsingFlags(n).invalidEra=t}),addRegexToken("y",matchUnsigned),addRegexToken("yy",matchUnsigned),addRegexToken("yyy",matchUnsigned),addRegexToken("yyyy",matchUnsigned),addRegexToken("yo",matchEraYearOrdinal),addParseToken(["y","yy","yyy","yyyy"],YEAR),addParseToken(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[YEAR]=n._locale.eraYearOrdinalParse(t,i):e[YEAR]=parseInt(t,10)});function localeEras(t,e){var n,r,i,g=this._eras||getLocale("en")._eras;for(n=0,r=g.length;n<r;++n){switch(typeof g[n].since){case"string":i=hooks(g[n].since).startOf("day"),g[n].since=i.valueOf();break}switch(typeof g[n].until){case"undefined":g[n].until=1/0;break;case"string":i=hooks(g[n].until).startOf("day").valueOf(),g[n].until=i.valueOf();break}}return g}function localeErasParse(t,e,n){var r,i,g=this.eras(),y,k,L;for(t=t.toUpperCase(),r=0,i=g.length;r<i;++r)if(y=g[r].name.toUpperCase(),k=g[r].abbr.toUpperCase(),L=g[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(k===t)return g[r];break;case"NNNN":if(y===t)return g[r];break;case"NNNNN":if(L===t)return g[r];break}else if([y,k,L].indexOf(t)>=0)return g[r]}function localeErasConvertYear(t,e){var n=t.since<=t.until?1:-1;return e===void 0?hooks(t.since).year():hooks(t.since).year()+(e-t.offset)*n}function getEraName(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function getEraNarrow(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function getEraAbbr(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function getEraYear(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-hooks(i[t].since).year())*n+i[t].offset;return this.year()}function erasNameRegex(t){return hasOwnProp(this,"_erasNameRegex")||computeErasParse.call(this),t?this._erasNameRegex:this._erasRegex}function erasAbbrRegex(t){return hasOwnProp(this,"_erasAbbrRegex")||computeErasParse.call(this),t?this._erasAbbrRegex:this._erasRegex}function erasNarrowRegex(t){return hasOwnProp(this,"_erasNarrowRegex")||computeErasParse.call(this),t?this._erasNarrowRegex:this._erasRegex}function matchEraAbbr(t,e){return e.erasAbbrRegex(t)}function matchEraName(t,e){return e.erasNameRegex(t)}function matchEraNarrow(t,e){return e.erasNarrowRegex(t)}function matchEraYearOrdinal(t,e){return e._eraYearOrdinalRegex||matchUnsigned}function computeErasParse(){var t=[],e=[],n=[],r=[],i,g,y,k,L,$=this.eras();for(i=0,g=$.length;i<g;++i)y=regexEscape($[i].name),k=regexEscape($[i].abbr),L=regexEscape($[i].narrow),e.push(y),t.push(k),n.push(L),r.push(y),r.push(k),r.push(L);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}addFormatToken(0,["gg",2],0,function(){return this.weekYear()%100}),addFormatToken(0,["GG",2],0,function(){return this.isoWeekYear()%100});function addWeekYearFormatToken(t,e){addFormatToken(0,[t,t.length],0,e)}addWeekYearFormatToken("gggg","weekYear"),addWeekYearFormatToken("ggggg","weekYear"),addWeekYearFormatToken("GGGG","isoWeekYear"),addWeekYearFormatToken("GGGGG","isoWeekYear"),addRegexToken("G",matchSigned),addRegexToken("g",matchSigned),addRegexToken("GG",match1to2,match2),addRegexToken("gg",match1to2,match2),addRegexToken("GGGG",match1to4,match4),addRegexToken("gggg",match1to4,match4),addRegexToken("GGGGG",match1to6,match6),addRegexToken("ggggg",match1to6,match6),addWeekParseToken(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=toInt(t)}),addWeekParseToken(["gg","GG"],function(t,e,n,r){e[r]=hooks.parseTwoDigitYear(t)});function getSetWeekYear(t){return getSetWeekYearHelper.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function getSetISOWeekYear(t){return getSetWeekYearHelper.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function getISOWeeksInYear(){return weeksInYear(this.year(),1,4)}function getISOWeeksInISOWeekYear(){return weeksInYear(this.isoWeekYear(),1,4)}function getWeeksInYear(){var t=this.localeData()._week;return weeksInYear(this.year(),t.dow,t.doy)}function getWeeksInWeekYear(){var t=this.localeData()._week;return weeksInYear(this.weekYear(),t.dow,t.doy)}function getSetWeekYearHelper(t,e,n,r,i){var g;return t==null?weekOfYear(this,r,i).year:(g=weeksInYear(t,r,i),e>g&&(e=g),setWeekAll.call(this,t,e,n,r,i))}function setWeekAll(t,e,n,r,i){var g=dayOfYearFromWeeks(t,e,n,r,i),y=createUTCDate(g.year,0,g.dayOfYear);return this.year(y.getUTCFullYear()),this.month(y.getUTCMonth()),this.date(y.getUTCDate()),this}addFormatToken("Q",0,"Qo","quarter"),addRegexToken("Q",match1),addParseToken("Q",function(t,e){e[MONTH]=(toInt(t)-1)*3});function getSetQuarter(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}addFormatToken("D",["DD",2],"Do","date"),addRegexToken("D",match1to2,match1to2NoLeadingZero),addRegexToken("DD",match1to2,match2),addRegexToken("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),addParseToken(["D","DD"],DATE),addParseToken("Do",function(t,e){e[DATE]=toInt(t.match(match1to2)[0])});var getSetDayOfMonth=makeGetSet("Date",!0);addFormatToken("DDD",["DDDD",3],"DDDo","dayOfYear"),addRegexToken("DDD",match1to3),addRegexToken("DDDD",match3),addParseToken(["DDD","DDDD"],function(t,e,n){n._dayOfYear=toInt(t)});function getSetDayOfYear(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}addFormatToken("m",["mm",2],0,"minute"),addRegexToken("m",match1to2,match1to2HasZero),addRegexToken("mm",match1to2,match2),addParseToken(["m","mm"],MINUTE);var getSetMinute=makeGetSet("Minutes",!1);addFormatToken("s",["ss",2],0,"second"),addRegexToken("s",match1to2,match1to2HasZero),addRegexToken("ss",match1to2,match2),addParseToken(["s","ss"],SECOND);var getSetSecond=makeGetSet("Seconds",!1);addFormatToken("S",0,0,function(){return~~(this.millisecond()/100)}),addFormatToken(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),addFormatToken(0,["SSS",3],0,"millisecond"),addFormatToken(0,["SSSS",4],0,function(){return this.millisecond()*10}),addFormatToken(0,["SSSSS",5],0,function(){return this.millisecond()*100}),addFormatToken(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),addFormatToken(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),addFormatToken(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),addFormatToken(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),addRegexToken("S",match1to3,match1),addRegexToken("SS",match1to3,match2),addRegexToken("SSS",match1to3,match3);var token,getSetMillisecond;for(token="SSSS";token.length<=9;token+="S")addRegexToken(token,matchUnsigned);function parseMs(t,e){e[MILLISECOND]=toInt(("0."+t)*1e3)}for(token="S";token.length<=9;token+="S")addParseToken(token,parseMs);getSetMillisecond=makeGetSet("Milliseconds",!1),addFormatToken("z",0,0,"zoneAbbr"),addFormatToken("zz",0,0,"zoneName");function getZoneAbbr(){return this._isUTC?"UTC":""}function getZoneName(){return this._isUTC?"Coordinated Universal Time":""}var proto=Moment.prototype;proto.add=add$3,proto.calendar=calendar$1,proto.clone=clone$2,proto.diff=diff,proto.endOf=endOf,proto.format=format,proto.from=from,proto.fromNow=fromNow,proto.to=to,proto.toNow=toNow,proto.get=stringGet,proto.invalidAt=invalidAt,proto.isAfter=isAfter,proto.isBefore=isBefore,proto.isBetween=isBetween,proto.isSame=isSame,proto.isSameOrAfter=isSameOrAfter,proto.isSameOrBefore=isSameOrBefore,proto.isValid=isValid$2,proto.lang=lang,proto.locale=locale,proto.localeData=localeData,proto.max=prototypeMax,proto.min=prototypeMin,proto.parsingFlags=parsingFlags,proto.set=stringSet,proto.startOf=startOf,proto.subtract=subtract,proto.toArray=toArray$1,proto.toObject=toObject,proto.toDate=toDate,proto.toISOString=toISOString,proto.inspect=inspect,typeof Symbol<"u"&&Symbol.for!=null&&(proto[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),proto.toJSON=toJSON,proto.toString=toString$2,proto.unix=unix,proto.valueOf=valueOf,proto.creationData=creationData,proto.eraName=getEraName,proto.eraNarrow=getEraNarrow,proto.eraAbbr=getEraAbbr,proto.eraYear=getEraYear,proto.year=getSetYear,proto.isLeapYear=getIsLeapYear,proto.weekYear=getSetWeekYear,proto.isoWeekYear=getSetISOWeekYear,proto.quarter=proto.quarters=getSetQuarter,proto.month=getSetMonth,proto.daysInMonth=getDaysInMonth,proto.week=proto.weeks=getSetWeek,proto.isoWeek=proto.isoWeeks=getSetISOWeek,proto.weeksInYear=getWeeksInYear,proto.weeksInWeekYear=getWeeksInWeekYear,proto.isoWeeksInYear=getISOWeeksInYear,proto.isoWeeksInISOWeekYear=getISOWeeksInISOWeekYear,proto.date=getSetDayOfMonth,proto.day=proto.days=getSetDayOfWeek,proto.weekday=getSetLocaleDayOfWeek,proto.isoWeekday=getSetISODayOfWeek,proto.dayOfYear=getSetDayOfYear,proto.hour=proto.hours=getSetHour,proto.minute=proto.minutes=getSetMinute,proto.second=proto.seconds=getSetSecond,proto.millisecond=proto.milliseconds=getSetMillisecond,proto.utcOffset=getSetOffset,proto.utc=setOffsetToUTC,proto.local=setOffsetToLocal,proto.parseZone=setOffsetToParsedOffset,proto.hasAlignedHourOffset=hasAlignedHourOffset,proto.isDST=isDaylightSavingTime,proto.isLocal=isLocal,proto.isUtcOffset=isUtcOffset,proto.isUtc=isUtc,proto.isUTC=isUtc,proto.zoneAbbr=getZoneAbbr,proto.zoneName=getZoneName,proto.dates=deprecate("dates accessor is deprecated. Use date instead.",getSetDayOfMonth),proto.months=deprecate("months accessor is deprecated. Use month instead",getSetMonth),proto.years=deprecate("years accessor is deprecated. Use year instead",getSetYear),proto.zone=deprecate("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",getSetZone),proto.isDSTShifted=deprecate("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",isDaylightSavingTimeShifted);function createUnix(t){return createLocal(t*1e3)}function createInZone(){return createLocal.apply(null,arguments).parseZone()}function preParsePostFormat(t){return t}var proto$1=Locale.prototype;proto$1.calendar=calendar,proto$1.longDateFormat=longDateFormat,proto$1.invalidDate=invalidDate,proto$1.ordinal=ordinal,proto$1.preparse=preParsePostFormat,proto$1.postformat=preParsePostFormat,proto$1.relativeTime=relativeTime,proto$1.pastFuture=pastFuture,proto$1.set=set$1,proto$1.eras=localeEras,proto$1.erasParse=localeErasParse,proto$1.erasConvertYear=localeErasConvertYear,proto$1.erasAbbrRegex=erasAbbrRegex,proto$1.erasNameRegex=erasNameRegex,proto$1.erasNarrowRegex=erasNarrowRegex,proto$1.months=localeMonths,proto$1.monthsShort=localeMonthsShort,proto$1.monthsParse=localeMonthsParse,proto$1.monthsRegex=monthsRegex,proto$1.monthsShortRegex=monthsShortRegex,proto$1.week=localeWeek,proto$1.firstDayOfYear=localeFirstDayOfYear,proto$1.firstDayOfWeek=localeFirstDayOfWeek,proto$1.weekdays=localeWeekdays,proto$1.weekdaysMin=localeWeekdaysMin,proto$1.weekdaysShort=localeWeekdaysShort,proto$1.weekdaysParse=localeWeekdaysParse,proto$1.weekdaysRegex=weekdaysRegex,proto$1.weekdaysShortRegex=weekdaysShortRegex,proto$1.weekdaysMinRegex=weekdaysMinRegex,proto$1.isPM=localeIsPM,proto$1.meridiem=localeMeridiem;function get$1$1(t,e,n,r){var i=getLocale(),g=createUTC().set(r,e);return i[n](g,t)}function listMonthsImpl(t,e,n){if(isNumber(t)&&(e=t,t=void 0),t=t||"",e!=null)return get$1$1(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=get$1$1(t,r,n,"month");return i}function listWeekdaysImpl(t,e,n,r){typeof t=="boolean"?(isNumber(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,isNumber(e)&&(n=e,e=void 0),e=e||"");var i=getLocale(),g=t?i._week.dow:0,y,k=[];if(n!=null)return get$1$1(e,(n+g)%7,r,"day");for(y=0;y<7;y++)k[y]=get$1$1(e,(y+g)%7,r,"day");return k}function listMonths(t,e){return listMonthsImpl(t,e,"months")}function listMonthsShort(t,e){return listMonthsImpl(t,e,"monthsShort")}function listWeekdays(t,e,n){return listWeekdaysImpl(t,e,n,"weekdays")}function listWeekdaysShort(t,e,n){return listWeekdaysImpl(t,e,n,"weekdaysShort")}function listWeekdaysMin(t,e,n){return listWeekdaysImpl(t,e,n,"weekdaysMin")}getSetGlobalLocale("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=toInt(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),hooks.lang=deprecate("moment.lang is deprecated. Use moment.locale instead.",getSetGlobalLocale),hooks.langData=deprecate("moment.langData is deprecated. Use moment.localeData instead.",getLocale);var mathAbs=Math.abs;function abs(){var t=this._data;return this._milliseconds=mathAbs(this._milliseconds),this._days=mathAbs(this._days),this._months=mathAbs(this._months),t.milliseconds=mathAbs(t.milliseconds),t.seconds=mathAbs(t.seconds),t.minutes=mathAbs(t.minutes),t.hours=mathAbs(t.hours),t.months=mathAbs(t.months),t.years=mathAbs(t.years),this}function addSubtract$1(t,e,n,r){var i=createDuration(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function add$1$1(t,e){return addSubtract$1(this,t,e,1)}function subtract$1(t,e){return addSubtract$1(this,t,e,-1)}function absCeil(t){return t<0?Math.floor(t):Math.ceil(t)}function bubble(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,g,y,k,L;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=absCeil(monthsToDays(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=absFloor(t/1e3),r.seconds=i%60,g=absFloor(i/60),r.minutes=g%60,y=absFloor(g/60),r.hours=y%24,e+=absFloor(y/24),L=absFloor(daysToMonths(e)),n+=L,e-=absCeil(monthsToDays(L)),k=absFloor(n/12),n%=12,r.days=e,r.months=n,r.years=k,this}function daysToMonths(t){return t*4800/146097}function monthsToDays(t){return t*146097/4800}function as(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=normalizeUnits(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+daysToMonths(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(monthsToDays(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function makeAs(t){return function(){return this.as(t)}}var asMilliseconds=makeAs("ms"),asSeconds=makeAs("s"),asMinutes=makeAs("m"),asHours=makeAs("h"),asDays=makeAs("d"),asWeeks=makeAs("w"),asMonths=makeAs("M"),asQuarters=makeAs("Q"),asYears=makeAs("y"),valueOf$1=asMilliseconds;function clone$1$1(){return createDuration(this)}function get$2$1(t){return t=normalizeUnits(t),this.isValid()?this[t+"s"]():NaN}function makeGetter(t){return function(){return this.isValid()?this._data[t]:NaN}}var milliseconds=makeGetter("milliseconds"),seconds=makeGetter("seconds"),minutes=makeGetter("minutes"),hours=makeGetter("hours"),days=makeGetter("days"),months=makeGetter("months"),years=makeGetter("years");function weeks(){return absFloor(this.days()/7)}var round=Math.round,thresholds={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function substituteTimeAgo(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function relativeTime$1(t,e,n,r){var i=createDuration(t).abs(),g=round(i.as("s")),y=round(i.as("m")),k=round(i.as("h")),L=round(i.as("d")),$=round(i.as("M")),V=round(i.as("w")),z=round(i.as("y")),j=g<=n.ss&&["s",g]||g<n.s&&["ss",g]||y<=1&&["m"]||y<n.m&&["mm",y]||k<=1&&["h"]||k<n.h&&["hh",k]||L<=1&&["d"]||L<n.d&&["dd",L];return n.w!=null&&(j=j||V<=1&&["w"]||V<n.w&&["ww",V]),j=j||$<=1&&["M"]||$<n.M&&["MM",$]||z<=1&&["y"]||["yy",z],j[2]=e,j[3]=+t>0,j[4]=r,substituteTimeAgo.apply(null,j)}function getSetRelativeTimeRounding(t){return t===void 0?round:typeof t=="function"?(round=t,!0):!1}function getSetRelativeTimeThreshold(t,e){return thresholds[t]===void 0?!1:e===void 0?thresholds[t]:(thresholds[t]=e,t==="s"&&(thresholds.ss=e-1),!0)}function humanize(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=thresholds,i,g;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},thresholds,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),g=relativeTime$1(this,!n,r,i),n&&(g=i.pastFuture(+this,g)),i.postformat(g)}var abs$1=Math.abs;function sign(t){return(t>0)-(t<0)||+t}function toISOString$1(){if(!this.isValid())return this.localeData().invalidDate();var t=abs$1(this._milliseconds)/1e3,e=abs$1(this._days),n=abs$1(this._months),r,i,g,y,k=this.asSeconds(),L,$,V,z;return k?(r=absFloor(t/60),i=absFloor(r/60),t%=60,r%=60,g=absFloor(n/12),n%=12,y=t?t.toFixed(3).replace(/\.?0+$/,""):"",L=k<0?"-":"",$=sign(this._months)!==sign(k)?"-":"",V=sign(this._days)!==sign(k)?"-":"",z=sign(this._milliseconds)!==sign(k)?"-":"",L+"P"+(g?$+g+"Y":"")+(n?$+n+"M":"")+(e?V+e+"D":"")+(i||r||t?"T":"")+(i?z+i+"H":"")+(r?z+r+"M":"")+(t?z+y+"S":"")):"P0D"}var proto$2=Duration.prototype;proto$2.isValid=isValid$1,proto$2.abs=abs,proto$2.add=add$1$1,proto$2.subtract=subtract$1,proto$2.as=as,proto$2.asMilliseconds=asMilliseconds,proto$2.asSeconds=asSeconds,proto$2.asMinutes=asMinutes,proto$2.asHours=asHours,proto$2.asDays=asDays,proto$2.asWeeks=asWeeks,proto$2.asMonths=asMonths,proto$2.asQuarters=asQuarters,proto$2.asYears=asYears,proto$2.valueOf=valueOf$1,proto$2._bubble=bubble,proto$2.clone=clone$1$1,proto$2.get=get$2$1,proto$2.milliseconds=milliseconds,proto$2.seconds=seconds,proto$2.minutes=minutes,proto$2.hours=hours,proto$2.days=days,proto$2.weeks=weeks,proto$2.months=months,proto$2.years=years,proto$2.humanize=humanize,proto$2.toISOString=toISOString$1,proto$2.toString=toISOString$1,proto$2.toJSON=toISOString$1,proto$2.locale=locale,proto$2.localeData=localeData,proto$2.toIsoString=deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",toISOString$1),proto$2.lang=lang,addFormatToken("X",0,0,"unix"),addFormatToken("x",0,0,"valueOf"),addRegexToken("x",matchSigned),addRegexToken("X",matchTimestamp),addParseToken("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),addParseToken("x",function(t,e,n){n._d=new Date(toInt(t))});//! moment.js
53
- hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min,hooks.max=max,hooks.now=now,hooks.utc=createUTC,hooks.unix=createUnix,hooks.months=listMonths,hooks.isDate=isDate,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=listWeekdays,hooks.parseZone=createInZone,hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=listMonthsShort,hooks.weekdaysMin=listWeekdaysMin,hooks.defineLocale=defineLocale,hooks.updateLocale=updateLocale,hooks.locales=listLocales,hooks.weekdaysShort=listWeekdaysShort,hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=getSetRelativeTimeRounding,hooks.relativeTimeThreshold=getSetRelativeTimeThreshold,hooks.calendarFormat=getCalendarFormat,hooks.prototype=proto,hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const DEFAULT_VALUE$1="--",LOG_DATE_FORMAT_T="YYYY-MM-DDTHH:mm:ss",LOG_DATE_FORMAT_END="YYYY-MM-DDT23:59:59",DATE_PICKER_FORMAT="YYYY-MM-DD",CDN_URL$1="https://static.zhihaoscm.cn/",dateFormat=(t,e=DATE_PICKER_FORMAT)=>t?hooks(t).format(e).replace("Invalid date",DEFAULT_VALUE$1):DEFAULT_VALUE$1,validateNumber=t=>typeof t=="number"?!0:typeof t=="string"?!isNaN(parseFloat(t)):!1;function digitUppercase(t){const e=["角","分"],n=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=[["元","万","亿"],["","拾","佰","仟"]],i=t<0?"负":"";t=Math.abs(t);let g="";for(let y=0;y<e.length;y++)g+=(n[Math.floor(t*10*Math.pow(10,y))%10]+e[y]).replace(/零./,"");g=g||"整",t=Math.floor(t);for(let y=0;y<r[0].length&&t>0;y++){let k="";for(let L=0;L<r[1].length&&t>0;L++)k=n[t%10]+r[1][L]+k,t=Math.floor(t/10);g=k.replace(/(零.)*零$/,"").replace(/^$/,"零")+r[0][y]+g}return i+g.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整")}function hexToRgb(t){let e=t.replace(/^#/,"");e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return[n,r,i]}function calculateBrightness(t){const[e,n,r]=t;return .299*e+.587*n+.114*r}function getForegroundColor(t,e=128){t==="white"&&(t="#fff"),t==="black"&&(t="#000");const n=hexToRgb(t);return calculateBrightness(n)>e?"black":"white"}const _sfc_main$u=vue.defineComponent({name:"zh-date-picker",__name:"DatePicker",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,r=e,i=k=>Array.isArray(k)?[dateFormat(k[0],LOG_DATE_FORMAT_T),dateFormat(k[1],LOG_DATE_FORMAT_END)]:k&&dateFormat(k,LOG_DATE_FORMAT_T),g=k=>{const L=i(k);r("update:modelValue",L)},y=k=>{const L=i(k);r("change",L)};return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([n.class,"zh-date-picker"])},[vue.createVNode(vue.unref(ElDatePicker),vue.mergeProps(k.$attrs,{style:n.style,"model-value":n.modelValue,"onUpdate:modelValue":g,onChange:y}),null,16,["style","model-value"])],2))}}),ZhDatePicker=withInstall$1(_sfc_main$u),_hoisted_1$k={class:"info-pair"},_hoisted_2$e={class:"info-pair--title"},_hoisted_3$e={key:0,class:"info-pair--title--tip"},_sfc_main$t=vue.defineComponent({name:"zh-detail-sub-title",__name:"DetailSubTitle",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createElementVNode("div",_hoisted_2$e,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$e,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)])],2)]))}}),ZhDetailSubTitle=withInstall$1(_sfc_main$t),_hoisted_1$j={class:"title"},_hoisted_2$d={key:0,class:"sub-title"},_hoisted_3$d={class:"zh-dialog__footer"},_sfc_main$s=vue.defineComponent({name:"ZhDialog",inheritAttrs:!1,__name:"Dialog",props:vue.mergeModels({title:{},subTitle:{},cancelButtonText:{default:"取消"},confirmButtonText:{default:"确定"},confirmButtonDisabled:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1},size:{default:"middle"},width:{},appendToBody:{type:Boolean},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean},closeOnPressEscape:{type:Boolean},lockScroll:{type:Boolean},modal:{type:Boolean},openDelay:{},closeDelay:{},top:{},modelValue:{type:Boolean},modalClass:{},zIndex:{},trapFocus:{type:Boolean},headerAriaLevel:{},center:{type:Boolean},alignCenter:{type:Boolean},closeIcon:{},draggable:{type:Boolean},overflow:{type:Boolean},fullscreen:{type:Boolean},showClose:{type:Boolean},ariaLevel:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:vue.mergeModels(["submit","close"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=e,g=()=>{i("close")},y=()=>{i("submit")},k=()=>{i("close")},L={small:"400px",middle:"600px",large:"800px",extraLarge:"920px"},$=vue.computed(()=>n.width?n.width:L[n.size]);return(V,z)=>(vue.openBlock(),vue.createBlock(vue.unref(ElDialog),vue.mergeProps({modelValue:r.value,"onUpdate:modelValue":z[0]||(z[0]=j=>r.value=j),class:"zh-dialog"},V.$attrs,{width:$.value,"close-on-click-modal":V.closeOnClickModal,onClose:k}),{header:vue.withCtx(()=>[vue.renderSlot(V.$slots,"header",{},()=>[vue.createElementVNode("div",_hoisted_1$j,vue.toDisplayString(V.title),1),V.subTitle?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$d,vue.toDisplayString(V.subTitle),1)):vue.createCommentVNode("",!0)])]),footer:vue.withCtx(()=>[vue.renderSlot(V.$slots,"footer",{},()=>[vue.createElementVNode("div",_hoisted_3$d,[vue.createVNode(ZhButton$1,{plain:"",onClick:g},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.cancelButtonText),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",disabled:V.confirmButtonDisabled,onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.confirmButtonText),1)]),_:1},8,["disabled"])])])]),default:vue.withCtx(()=>[vue.renderSlot(V.$slots,"default")]),_:3},16,["modelValue","width","close-on-click-modal"]))}}),ZhDialog=withInstall$1(_sfc_main$s),_hoisted_1$i={class:"info-pair"},_hoisted_2$c={class:"info-pair--title"},_hoisted_3$c={key:0,class:"info-pair--title--tip"},_sfc_main$r=vue.defineComponent({name:"zh-edit-info-pair",__name:"EditInfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",_hoisted_2$c,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$c,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),EditInfoPair=_export_sfc(_sfc_main$r,[["__scopeId","data-v-8ed96c83"]]),ZhEditInfoPair=withInstall$1(EditInfoPair),_hoisted_1$h={class:"file_wrapper"},_hoisted_2$b={key:0,class:"header"},_hoisted_3$b={class:"file_main"},_hoisted_4$6={class:"file"},_hoisted_5$6={class:"file_name"},_sfc_main$q=vue.defineComponent({name:"zh-file-wrapper",__name:"FileWrapper",props:{downLoadUrl:{type:String,default:""},canPreview:{type:Boolean,default:!1},fileName:{type:String,default:DEFAULT_VALUE$1},canDelete:{type:Boolean,default:!1},title:{type:String,default:""},fileId:{type:Number,default:0}},emits:["deleteFile"],setup(t,{emit:e}){const n=t,r=e,i=()=>{n.canDelete&&r("deleteFile",n.fileId)};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[n.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$b,vue.toDisplayString(n.title),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$b,[vue.createElementVNode("div",_hoisted_4$6,[y[0]||(y[0]=vue.createElementVNode("div",{class:"file_type mr-12"},[vue.createElementVNode("i",{class:"iconfont icon-xiangmuguanli"})],-1)),vue.createElementVNode("div",_hoisted_5$6,vue.toDisplayString(n.fileName),1)]),vue.createVNode(vue.unref(ElLink),{size:"small",class:"btn",link:"",style:{width:"80px"},href:n.downLoadUrl,underline:!1,download:"download"},{default:vue.withCtx(()=>y[1]||(y[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href"]),t.canDelete?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close close",onClick:i})):vue.createCommentVNode("",!0)])]))}}),FileWrapper=_export_sfc(_sfc_main$q,[["__scopeId","data-v-480bb0e6"]]),ZhFileWrapper=withInstall$1(FileWrapper),_sfc_main$p=vue.defineComponent({name:"Grid",__name:"Grid",props:{cols:{default:()=>({xs:1,sm:2,md:2,lg:4,xl:4})},collapsed:{type:Boolean,default:!1},collapsedRows:{default:1},gap:{default:16},enableSameLabelWidthInCol:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=t;vue.onBeforeMount(()=>n.collapsed&&L()),vue.onMounted(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onActivated(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onUnmounted(()=>{window.removeEventListener("resize",r)}),vue.onDeactivated(()=>{window.removeEventListener("resize",r)});const r=j=>{let oe=j.target.innerWidth;switch(!!oe){case oe<768:i.value="xs";break;case(oe>=768&&oe<992):i.value="sm";break;case(oe>=992&&oe<1200):i.value="md";break;case(oe>=1200&&oe<1920):i.value="lg";break;case oe>=1920:i.value="xl";break}};vue.provide("gap",Array.isArray(n.gap)?n.gap[0]:n.gap);let i=vue.ref("xl");vue.provide("breakPoint",i);const g=vue.ref(-1);vue.provide("shouldHiddenIndex",g);const y=vue.computed(()=>typeof n.cols=="object"?n.cols[i.value]??n.cols:n.cols);vue.provide("cols",y);const k=vue.useSlots().default(),L=()=>{var ie,ae,le,de;let j=[],oe=null;k.forEach(pe=>{var ue;typeof pe.type=="object"&&pe.type.name==="GridItem"&&((ue=pe.props)==null?void 0:ue.suffix)!==void 0&&(oe=pe),typeof pe.type=="symbol"&&Array.isArray(pe.children)&&j.push(...pe.children)});let re=0;oe&&(re=(((ie=oe.props[i.value])==null?void 0:ie.span)??((ae=oe.props)==null?void 0:ae.span)??1)+(((le=oe.props[i.value])==null?void 0:le.offset)??((de=oe.props)==null?void 0:de.offset)??0));try{let pe=!1;j.reduce((ue=0,he,Ce)=>{var _e,xe,Ie,Oe;if(ue+=(((_e=he.props[i.value])==null?void 0:_e.span)??((xe=he.props)==null?void 0:xe.span)??1)+(((Ie=he.props[i.value])==null?void 0:Ie.offset)??((Oe=he.props)==null?void 0:Oe.offset)??0),Number(ue)>n.collapsedRows*y.value-re)throw g.value=Ce,pe=!0,"find it";return ue},0),pe||(g.value=-1)}catch{}};vue.watch(()=>i.value,()=>{n.collapsed&&L()}),vue.watch(()=>n.collapsed,j=>{if(j)return L();g.value=-1});const $=vue.computed(()=>typeof n.gap=="number"?`${n.gap}px`:Array.isArray(n.gap)?`${n.gap[1]}px ${n.gap[0]}px`:"unset"),V=vue.computed(()=>({display:"grid",gridGap:$.value,gridTemplateColumns:`repeat(${y.value}, minmax(0, 1fr))`})),z=vue.ref(!1);return vue.onMounted(()=>{z.value=!0}),vue.onBeforeUpdate(()=>{z.value=!1}),vue.onUpdated(()=>{z.value=!0}),vue.provide("isRegistrationComplete",z),e({breakPoint:i}),(j,oe)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(V.value)},[vue.renderSlot(j.$slots,"default")],4))}}),_sfc_main$o=vue.defineComponent({name:"GridItem",__name:"GridItem",props:{offset:{default:0},span:{default:1},suffix:{type:Boolean,default:!1},xs:{default:void 0},sm:{default:void 0},md:{default:void 0},lg:{default:void 0},xl:{default:void 0},label:{}},setup(t){const e=t,n=vue.useAttrs(),r=vue.ref(!0),i=vue.inject("breakPoint",vue.ref("xl")),g=vue.inject("shouldHiddenIndex",vue.ref(-1));vue.watch(()=>[g.value,i.value],le=>{n.index&&(r.value=!(le[0]!==-1&&parseInt(n.index)>=Number(le[0])))},{immediate:!0});const y=vue.inject("gap",0),k=vue.inject("cols",vue.ref(4)),L=vue.computed(()=>{var pe,ue;let le=((pe=e[i.value])==null?void 0:pe.span)??e.span,de=((ue=e[i.value])==null?void 0:ue.offset)??e.offset;return e.suffix?{gridColumnStart:k.value-le-de+1,gridColumnEnd:`span ${le+de}`,marginLeft:de!==0?`calc(((100% + ${y}px) / ${le+de}) * ${de})`:"unset"}:{gridColumn:`span ${le+de>k.value?k.value:le+de}/span ${le+de>k.value?k.value:le+de}`,marginLeft:de!==0?`calc(((100% + ${y}px) / ${le+de}) * ${de})`:"unset"}}),$=vue.inject("isMultiGrid",vue.ref(!1)),V=vue.ref(null),z=vue.ref(0),j=vue.ref(0),oe=vue.inject("registerGridItem",null),re=vue.inject("getColumnData",null),ie=vue.inject("isRegistrationComplete",vue.ref(!1)),ae=()=>{if(V.value&&oe){const le=V.value.parentElement;if(le){const de=V.value.offsetLeft,pe=le.offsetWidth/k.value;j.value=Math.floor(de/pe)+1,oe(j.value,e.label||"")}}};return vue.watchEffect(()=>{if($.value&&ie.value&&e.label&&V.value&&(ae(),re)){const le=re(j.value);z.value=le.maxWidth||0}}),(le,de)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(L.value),ref_key:"gridItemRef",ref:V},[vue.renderSlot(le.$slots,"default",{maxLabelWidthInCol:z.value,columnIndex:j.value})],4)),[[vue.vShow,r.value]])}}),DEFAULT_FONT_SIZE=12;function findItemNested(t,e,n,r){return t.reduce((i,g)=>{if(i)return i;if(g[n]===e)return g;if(g[r])return findItemNested(g[r],e,n,r)},null)}function getValueByProp(t,e,n){const r=isUndefined$2(n)?DEFAULT_VALUE$1:n,i=get$5(t,e);return isNil(i)||i===""?r:i}const $get=getValueByProp;function handleProp(t){const e=t.split(".");return e.length==1?t:e[e.length-1]}function filterEnum(t,e,n,r){const i=(n==null?void 0:n.value)??"value",g=(n==null?void 0:n.label)??"label",y=(n==null?void 0:n.children)??"children";let k={};return Array.isArray(e)&&(k=findItemNested(e,t,i,y)),r=="tag"?k!=null&&k.tagType?k.tagType:"":k?k[g]:DEFAULT_VALUE$1}function filterEnumObj(t,e,n){const r="value",i="children";let g={};return Array.isArray(e)&&(g=findItemNested(e,t,r,i)),g}function formatValue(t){return isArray$2(t)?t.length?t.join(" / "):DEFAULT_VALUE$1:t??DEFAULT_VALUE$1}function handleRowAccordingToProp(t,e){return e.includes(".")?(e.split(".").forEach(n=>t=t[n]??DEFAULT_VALUE$1),t):t[e]??DEFAULT_VALUE$1}const getWidthByText=(t,e)=>{const n=e||DEFAULT_FONT_SIZE,i=document.createElement("canvas").getContext("2d");return i.font=`${n}px Microsoft YaHei`,i.measureText(t).width},useColSetting=t=>{const e=t||"zhihao-col-setting",n=()=>{const k=localStorage.getItem(e);return k?JSON.parse(k):{}},r=k=>{localStorage.setItem(e,JSON.stringify(k))};return{getMap:n,setMap:r,getColumnCache:k=>n()[k]||[],setColumnCache:(k,L)=>{const $=n();$[k]=L,r($)},removeColumnCache:k=>{const L=n();delete L[k],r(L)}}},collectGridItems=()=>{const t=vue.reactive({});return{gridItemData:t,registerGridItem:(r,i)=>{var y;if(!i)return;t[r]||(t[r]={labels:[],maxLength:0,maxWidth:0}),(y=t[r])==null||y.labels.push(i),t[r].maxLength=Math.max(i.length,t[r].maxLength);const g=Math.ceil(getWidthByText(i,14));t[r].maxWidth=Math.max(g||0,t[r].maxWidth)},getColumnData:r=>t[r]||{}}},_hoisted_1$g={class:"multi-grid"},_sfc_main$n=vue.defineComponent({name:"MultiGrid",__name:"MultiGrid",setup(t){const{getColumnData:e,registerGridItem:n}=collectGridItems();return vue.provide("registerGridItem",n),vue.provide("getColumnData",e),vue.provide("isMultiGrid",vue.ref(!0)),(r,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$g,[vue.renderSlot(r.$slots,"default")]))}}),ZhGrid=withInstall$1(_sfc_main$p),ZhGridItem=withInstall$1(_sfc_main$o),ZhMultiGrid=withInstall$1(_sfc_main$n),_hoisted_1$f={class:"info-pair"},_hoisted_2$a={class:"info-pair--title"},_hoisted_3$a={key:0,class:"info-pair--title--tip"},_sfc_main$m=vue.defineComponent({name:"zh-info-pair",__name:"InfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$f,[vue.createElementVNode("div",_hoisted_2$a,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$a,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),InfoPair=_export_sfc(_sfc_main$m,[["__scopeId","data-v-7c46e10e"]]),ZhInfoPair=withInstall$1(InfoPair),_sfc_main$l=vue.defineComponent({name:"zh-input",__name:"Input",props:vue.mergeModels({style:{},class:{default:"zh-default-input"},size:{default:"default"},className:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=vue.useAttrs(),n=t,r=vue.useModel(t,"modelValue"),i=()=>{(e.max||Number(e.max)===0)&&Number(r.value)>=e.max&&(r.value=e.max.toString()),(e.min||Number(e.min)===0)&&Number(r.value)<=e.min&&(r.value=e.min.toString())};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(n.class)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps(g.$attrs,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),size:g.size,onBlur:i}),vue.createSlots({_:2},[vue.renderList(g.$slots,(k,L)=>({name:k,fn:vue.withCtx($=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","size"])],2))}}),Input=_export_sfc(_sfc_main$l,[["__scopeId","data-v-75a9ec9f"]]),ZhInput=withInstall$1(Input),_sfc_main$k=vue.defineComponent({name:"zh-input-number",__name:"InputNumber",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=vue.useAttrs(),g=($,V=0,z=0,j=0)=>{let oe=($==null?void 0:$.toString())??"",re,ie,ae;return z===0?(oe=oe.replace(/[^\d]/g,""),oe=oe.replace(/^0\d+/g,"0"),V!==0&&(oe=oe.slice(0,V))):(oe=oe.replace(/[^\-\d.]/g,""),oe=oe.replace(/^[^\-\d]/g,""),oe=oe.replace(/\.{2}/g,"."),oe=oe.replace(/^0(\d+)/g,"$1"),re=oe.split(".")||[],re.length>1?(V===0?ie=re[0]:ie=re[0].slice(0,V),ae=re[1].slice(0,z),oe=ie+"."+ae):V!==0&&(oe=oe.slice(0,V))),j!==0&&(oe=oe.slice(0,j)),oe},y=()=>{n.modelValue===""||n.modelValue===void 0||(i.max&&Number(n.modelValue)>i.max&&r("update:modelValue",i.max.toString()),i.min&&Number(n.modelValue)<i.min&&r("update:modelValue",i.min.toString()))},k=$=>$?g($,i.integer,i.precision,i.maxLength):"",L=$=>{/^\d+\.0*$/.test(($==null?void 0:$.toString())||"")||$===""?r("update:modelValue",k($)):r("update:modelValue",Number(k($)))};return($,V)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["input-number",n.class]),style:vue.normalizeStyle(n.style)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps($.$attrs,{"model-value":n.modelValue,"onUpdate:modelValue":L,onBlur:y,style:{width:"100%"},formatter:k}),vue.createSlots({_:2},[vue.renderList(Object.keys($.$slots),z=>({name:z,fn:vue.withCtx(j=>[vue.renderSlot($.$slots,z,vue.normalizeProps(vue.guardReactiveProps(j)),void 0,!0)])}))]),1040,["model-value"])],6))}}),InputNumber=_export_sfc(_sfc_main$k,[["__scopeId","data-v-32d536a9"]]),ZhInputNumber=withInstall$1(InputNumber),_hoisted_1$e={class:"loading-box"},_sfc_main$j=vue.defineComponent({name:"zh-loading",__name:"Loading",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,n[0]||(n[0]=[vue.createElementVNode("div",{class:"loading-wrap"},[vue.createElementVNode("span",{class:"dot dot-spin"},[vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i")])],-1)])))}}),Loading=_export_sfc(_sfc_main$j,[["__scopeId","data-v-bcc04aa5"]]),ZhLoading=withInstall$1(Loading),defaultOptions={type:"",showCancelButton:!0,showConfirmButton:!0,cancelButtonText:"取消",confirmButtonText:"确定",closeOnClickModal:!1,closeOnPressEscape:!1,showClose:!0,draggable:!1,center:!1,roundButton:!1},ZhMessageBox$1={confirm(t,e,n={}){return ElMessageBox.confirm(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-confirm"})},alert(t,e,n={}){return ElMessageBox.alert(t,e,{...defaultOptions,...n,showCancelButton:!1,customClass:"zh-message-box zh-message-alert"})},prompt(t,e,n={}){return ElMessageBox.prompt(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-prompt"})}},ZhConfirm=ZhMessageBox$1.confirm,ZhAlert=ZhMessageBox$1.alert,ZhPrompt=ZhMessageBox$1.prompt,ZhMessageBox=withInstall$1(ZhMessageBox$1),_sfc_main$i=vue.defineComponent({name:"zh-money-input",__name:"MoneyInput",props:vue.mergeModels({style:{},class:{},showTooltip:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:vue.mergeModels(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=vue.computed(()=>{if(r.value)return validateNumber(r.value)&&Number(r.value)>=1e3?digitUppercase(Number(r.value)):""}),g=vue.ref(!1);return(y,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{effect:"dark",content:i.value,placement:"top",visible:y.showTooltip&&g.value&&!!i.value},{default:vue.withCtx(()=>[vue.createVNode(InputNumber,vue.mergeProps(y.$attrs,{modelValue:r.value,"onUpdate:modelValue":k[0]||(k[0]=L=>r.value=L),style:n.style,class:n.class,onFocus:k[1]||(k[1]=()=>g.value=!0),onBlur:k[2]||(k[2]=()=>g.value=!1)}),vue.createSlots({_:2},[vue.renderList(Object.keys(y.$slots),L=>({name:L,fn:vue.withCtx($=>[vue.renderSlot(y.$slots,L,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","style","class"])]),_:3},8,["content","visible"]))}}),MoneyInput=_export_sfc(_sfc_main$i,[["__scopeId","data-v-d97e0edf"]]),ZhMoneyInput=withInstall$1(MoneyInput),_hoisted_1$d={class:"page-head"},_hoisted_2$9={class:"left-wrap"},_hoisted_3$9={class:"page-name"},_hoisted_4$5={class:"value"},_hoisted_5$5={class:"other-inform"},_hoisted_6$5={class:"label"},_hoisted_7$5={class:"value mg-r-24"},_hoisted_8$3={class:"status"},_sfc_main$h=vue.defineComponent({name:"zh-page-head-panel",__name:"PageHeadPanel",props:{dataSource:{}},setup(t){const e=t,{name:n,no:r,status:i,extendLabel:g,extendValue:y}=vue.toRefs(e.dataSource);return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$9,[vue.createElementVNode("span",_hoisted_3$9,vue.toDisplayString(vue.unref(n)),1),vue.createElementVNode("div",null,[L[0]||(L[0]=vue.createElementVNode("span",{class:"label mg-l-16"},"编号",-1)),vue.createElementVNode("span",_hoisted_4$5,vue.toDisplayString(vue.unref(r)),1)])]),vue.createElementVNode("div",_hoisted_5$5,[vue.renderSlot(k.$slots,"extend",{},()=>[vue.createElementVNode("span",_hoisted_6$5,vue.toDisplayString(vue.unref(g)),1),vue.createElementVNode("span",_hoisted_7$5,vue.toDisplayString(vue.unref(y)),1)],!0),vue.createElementVNode("span",_hoisted_8$3,vue.toDisplayString(vue.unref(i)),1)])]))}}),PageHeadPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-cecdddb2"]]),ZhPageHeadPanel=withInstall$1(PageHeadPanel),_sfc_main$g=vue.defineComponent({name:"zh-tool-tips",__name:"ToolTips",props:{placement:{type:String,default:"top"},content:{type:String,default:"top"}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:e.content,placement:e.placement},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},()=>[r[0]||(r[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame2"},null,-1))],!0)]),_:3},8,["content","placement"]))}}),ToolTips=_export_sfc(_sfc_main$g,[["__scopeId","data-v-93c79d22"]]),ZhToolTips=withInstall$1(ToolTips),_sfc_main$f=vue.defineComponent({name:"ZhBaseInfo",__name:"BaseInfo",props:{contentWidth:{default:void 0},labelWidth:{default:"70px"},infoDirection:{default:"vertical"},cols:{default:5},gap:{default:16}},setup(t){const e=t,n=vue.ref(),r=vue.ref(),i=vue.ref();vue.provide("infoLabelWidth",n),vue.provide("infoContentWidth",r),vue.provide("infoDirection",i);function g(){n.value=e.labelWidth}function y(){r.value=e.contentWidth}function k(){i.value=e.infoDirection}return vue.watch(()=>e.contentWidth,()=>y(),{immediate:!0}),vue.watch(()=>e.labelWidth,()=>g(),{immediate:!0}),vue.watch(()=>e.infoDirection,()=>k(),{immediate:!0}),(L,$)=>{const V=vue.resolveComponent("grid");return vue.openBlock(),vue.createBlock(V,{cols:L.cols,gap:L.gap},{default:vue.withCtx(()=>[vue.renderSlot(L.$slots,"default")]),_:3},8,["cols","gap"])}}}),ZhBaseInfo=withInstall$1(_sfc_main$f),_hoisted_1$c={class:"common-card"},_hoisted_2$8={class:"detail-header"},_hoisted_3$8={class:"detail-header--left"},_hoisted_4$4={class:"title common-title"},_hoisted_5$4={class:"info-pair--label"},_hoisted_6$4={class:"info-pair--value"},_hoisted_7$4={key:1,class:"detail-header--right"},_hoisted_8$2={class:"info-pair--label"},_hoisted_9$1={class:"info-pair--value"},_sfc_main$e=vue.defineComponent({name:"ZhDetailHeader",__name:"DetailHeader",props:{title:{},leftInfos:{},rightInfos:{},stateMeta:{},stateDesc:{}},setup(t){const e=vue.useSlots(),n=t;return(r,i)=>{var g,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.createElementVNode("div",null,[vue.renderSlot(r.$slots,"menu",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2$8,[vue.createElementVNode("div",_hoisted_3$8,[vue.createElementVNode("div",_hoisted_4$4,vue.toDisplayString(n.title),1),vue.renderSlot(r.$slots,"extra-info",{},void 0,!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.leftInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_5$4,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_6$4,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128))]),vue.renderSlot(r.$slots,"default",{},void 0,!0),vue.unref(e)["right-infos"]?vue.renderSlot(r.$slots,"right-infos",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.rightInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_8$2,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_9$1,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128)),r.stateDesc||r.stateMeta?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["state common-title",(g=r.stateMeta)==null?void 0:g.state])},vue.toDisplayString(r.stateDesc||((y=r.stateMeta)==null?void 0:y.intro)),3)):vue.createCommentVNode("",!0)]))])])}}}),DetailHeader=_export_sfc(_sfc_main$e,[["__scopeId","data-v-8b185816"]]),ZhDetailHeader=withInstall$1(DetailHeader);var DIY_DATA_TYPE=(t=>(t.AUTOCOMPLETE="autocomplete",t.FORMAT="format",t.TEXT="text",t))(DIY_DATA_TYPE||{});const _hoisted_1$b={key:0},_hoisted_2$7={key:1,class:"col-edit-header"},_hoisted_3$7=["onClick"],_hoisted_4$3={key:0},_hoisted_5$3={class:"header-operation-container"},_hoisted_6$3={class:"operation-container"},_hoisted_7$3=["onClick"],ZH_DIV="$ZH_DIV$",_sfc_main$d=vue.defineComponent({name:"zh-diy-data-table",__name:"DiyDataTable",props:vue.mergeModels({isEdit:{type:Boolean,default:!1},maxRowLength:{default:50},maxColLength:{default:10},defaultMinWidth:{default:120},beforeAddRow:{}},{rawData:{required:!0},rawDataModifiers:{}}),emits:["update:rawData"],setup(t,{expose:e}){const n=t,r=vue.useModel(t,"rawData"),i=vue.ref([]),g=()=>{if(r.value.length===n.maxRowLength){ElMessage({message:`最多添加${n.maxRowLength}行`,type:"warning"});return}let re={};n.beforeAddRow&&(re=n.beforeAddRow(r.value)),r.value.push(re)},y=()=>{if(i.value.filter(ae=>ae.isAdd).length>=n.maxColLength){ElMessage({message:`最多添加${n.maxColLength}列`,type:"warning"});return}const ie=String(Date.now());i.value.push({prop:ie,label:"",isEditHeader:!0,isAdd:!0,maxlength:15,minWidth:150,headerMaxlength:15})},k=(re,ie)=>{i.value.splice(re,1),r.value.forEach(ae=>{delete ae[ie.prop]})},L=re=>{re===0&&i.value.forEach(ie=>{ie.isSameData&&(r.value[1][ie.prop]=r.value[0][ie.prop])}),r.value.splice(re,1)},$=(re,ie,ae)=>{ie(ae.completeList.filter(le=>le.includes(re)).map(le=>({value:le})))},V=re=>[{validator:(ie,ae,le)=>{if(!i.value[re].label){le(new Error("请输入表头"));return}le()},message:"请输入表头",trigger:["blur","change"]}],z=re=>{const ie=[];return re.required&&ie.push({required:!0,message:"请输入"+re.label,trigger:re.slot?void 0:"blur"}),re.varidate&&ie.push({validator:(ae,le,de)=>{const pe=re.varidate(le);pe!==!0?de(new Error(pe)):de()},trigger:re.slot?void 0:"blur"}),ie},j=(re,ie)=>{let ae=re;return ie.isSameData&&(ae=r.value[0]||DEFAULT_VALUE$1),ie.formatter?ie.showFormatter?ie.type===DIY_DATA_TYPE.FORMAT?ie.showFormatter(ie.formatter(ae)):ie.showFormatter(ae[ie.prop]):ie.formatter(ae[ie.prop]):ae[ie.prop]||DEFAULT_VALUE$1},oe=vue.ref();return e({initData:(re,ie)=>{console.log("initData",re,ie),re=cloneDeep(re)||[],re.length===0&&re.push({}),ie=[...ie];for(const ae in re[0])if(!ie.some(le=>le.prop===ae)){const le=Date.now()+ae,de=ae.split(ZH_DIV);if(de.length!==2){console.log("keySplit 失败",ae);continue}const pe=Number(de[1]);ie[pe]={prop:ae,isEditHeader:!0,label:de[0],key:le,isAdd:!0,maxlength:15,headerMaxlength:15}}r.value=re,i.value=ie},getData:async()=>{await oe.value.validate();for(const ie in i.value){const ae=i.value[ie];for(const le of i.value)if(ae.prop!==le.prop&&ae.label===le.label){ElMessage({message:"所有列的表头不可重复",type:"warning"});return}}const re=cloneDeep(r.value);for(const ie in re){const ae=re[ie];for(const le in i.value){const de=i.value[le];if(de.isSameData&&ie!=="0"&&(ae[de.prop]=re[0][de.prop]),de.varidate&&!de.varidate(ae[de.prop]))return;if(de.isAdd){const pe=ae[de.prop];delete ae[de.prop];const ue=de.label+ZH_DIV+le;ae[ue]=pe}de.formatter&&de.type===DIY_DATA_TYPE.FORMAT&&(ae[de.prop]=de.formatter(ae))}}return console.log("DiyDataTable 获取数据",re,i.value),{data:re,columns:i.value}},updateColumn:(re,ie)=>{const ae=i.value[re].prop;if(i.value[re]=ie,ae!==ie.prop)for(const le of r.value)le[ie.prop]=le[ae],delete le[ae]},resetColumns:re=>{const ae=i.value.filter(de=>!de.isAdd).reduce((de,pe)=>(re.some(ue=>ue.prop===pe.prop)||de.push(pe.prop),de),[]);r.value.forEach(de=>{ae.forEach(pe=>{delete de[pe]})});const le=re.filter(de=>de.isAdd);i.value=[...re,...le]}}),(re,ie)=>(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{class:"diy-data-table",model:t.rawData,ref_key:"formRef",ref:oe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTable),{data:r.value},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{type:"index",label:"序号",width:"132",fixed:"left"}),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,(ae,le)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:ae.key||le,prop:ae.prop,label:ae.label,width:ae.width,"min-width":ae.minWidth||re.defaultMinWidth,fixed:ae.fixed},{header:vue.withCtx(()=>[re.isEdit?ae.isEditHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$7,[vue.createVNode(vue.unref(ElFormItem),{prop:`columns.${le}`,rules:V(le)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:ae.label,"onUpdate:modelValue":de=>ae.label=de,maxlength:ae.headerMaxlength||20,placeholder:"请输入表头"},null,8,["modelValue","onUpdate:modelValue","maxlength"])]),_:2},1032,["prop","rules"]),ae.isAdd?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:de=>k(le,ae)},null,8,_hoisted_3$7)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass({"is-required-label":ae.required})},vue.toDisplayString(ae.label),3)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,vue.toDisplayString(ae.label),1))]),default:vue.withCtx(de=>[n.isEdit&&(!ae.isSameData||de.$index===0)&&ae.type!==vue.unref(DIY_DATA_TYPE).TEXT?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,prop:`${de.$index}.${ae.prop}`,rules:z(ae),class:vue.normalizeClass(["col-edit-container",{"close-padding":ae.isAdd}])},{default:vue.withCtx(()=>[ae.type===vue.unref(DIY_DATA_TYPE).FORMAT&&ae.formatter?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$3,vue.toDisplayString(ae.showFormatter?ae.showFormatter(ae.formatter(de.row)):ae.formatter(de.row)),1)):ae.type===vue.unref(DIY_DATA_TYPE).AUTOCOMPLETE?(vue.openBlock(),vue.createBlock(vue.unref(ElAutocomplete),{key:1,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入","fetch-suggestions":(pe,ue)=>$(pe,ue,ae),maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","fetch-suggestions","maxlength"])):ae.slot?vue.renderSlot(re.$slots,ae.slot,{key:2,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入",formatter:ae.formatter,parser:ae.parser,maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","formatter","parser","maxlength"]))]),_:2},1032,["prop","rules","class"])):ae.slot?vue.renderSlot(re.$slots,ae.slot,{key:1,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(j(de.row,ae)),1)],64))]),_:2},1032,["prop","label","width","min-width","fixed"]))),128)),n.isEdit?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:0,width:"150",fixed:"right"},{header:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$3,[vue.createVNode(vue.unref(ElButton),{type:"primary",link:"",onClick:g},{default:vue.withCtx(()=>ie[0]||(ie[0]=[vue.createElementVNode("i",{class:"iconfont icon-Frame1"},null,-1),vue.createTextVNode("增行")])),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",link:"",onClick:y},{default:vue.withCtx(()=>ie[1]||(ie[1]=[vue.createElementVNode("i",{class:"iconfont icon-Frame-11"},null,-1),vue.createTextVNode("增列")])),_:1})])]),default:vue.withCtx(({$index:ae})=>[vue.createElementVNode("div",_hoisted_6$3,[r.value.length>1?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:le=>L(ae)},null,8,_hoisted_7$3)):vue.createCommentVNode("",!0)])]),_:1})):vue.createCommentVNode("",!0)]),_:3},8,["data"])]),_:3},8,["model"]))}}),DiyDataTable=_export_sfc(_sfc_main$d,[["__scopeId","data-v-52d02832"]]),ZhDiyDataTable=withInstall$1(DiyDataTable);var BaseMapType=(t=>(t[t.vector=0]="vector",t[t.satellite=1]="satellite",t))(BaseMapType||{});class BaseEvent{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ObjectEventType={PROPERTYCHANGE:"propertychange"};class Disposable{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function binarySearch(t,e,n){let r,i;n=n||ascending;let g=0,y=t.length,k=!1;for(;g<y;)r=g+(y-g>>1),i=+n(t[r],e),i<0?g=r+1:(y=r,k=!i);return k?g:~g}function ascending(t,e){return t>e?1:t<e?-1:0}function descending(t,e){return t<e?1:t>e?-1:0}function linearFindNearest(t,e,n){if(t[0]<=e)return 0;const r=t.length;if(e<=t[r-1])return r-1;if(typeof n=="function"){for(let i=1;i<r;++i){const g=t[i];if(g===e)return i;if(g<e)return n(e,t[i-1],g)>0?i-1:i}return r-1}if(n>0){for(let i=1;i<r;++i)if(t[i]<e)return i-1;return r-1}if(n<0){for(let i=1;i<r;++i)if(t[i]<=e)return i;return r-1}for(let i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return r-1}function reverseSubArray(t,e,n){for(;e<n;){const r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function extend$3(t,e){const n=Array.isArray(e)?e:[e],r=n.length;for(let i=0;i<r;i++)t[t.length]=n[i]}function equals$2(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function isSorted(t,e,n){const r=e||ascending;return t.every(function(i,g){if(g===0)return!0;const y=r(t[g-1],i);return!(y>0||y===0)})}function TRUE(){return!0}function FALSE(){return!1}function VOID(){}function memoizeOne(t){let e,n,r;return function(){const i=Array.prototype.slice.call(arguments);return(!n||this!==r||!equals$2(i,n))&&(r=this,n=i,e=t.apply(this,arguments)),e}}function toPromise(t){function e(){let n;try{n=t()}catch(r){return Promise.reject(r)}return n instanceof Promise?n:Promise.resolve(n)}return e()}function clear(t){for(const e in t)delete t[e]}function isEmpty$1(t){let e;for(e in t)return!1;return!e}class Target extends Disposable{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const r=this.listeners_||(this.listeners_={}),i=r[e]||(r[e]=[]);i.includes(n)||i.push(n)}dispatchEvent(e){const n=typeof e=="string",r=n?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;const g=n?new BaseEvent(e):e;g.target||(g.target=this.eventTarget_||this);const y=this.dispatching_||(this.dispatching_={}),k=this.pendingRemovals_||(this.pendingRemovals_={});r in y||(y[r]=0,k[r]=0),++y[r];let L;for(let $=0,V=i.length;$<V;++$)if("handleEvent"in i[$]?L=i[$].handleEvent(g):L=i[$].call(this,g),L===!1||g.propagationStopped){L=!1;break}if(--y[r]===0){let $=k[r];for(delete k[r];$--;)this.removeEventListener(r,VOID);delete y[r]}return L}disposeInternal(){this.listeners_&&clear(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,n){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const i=r.indexOf(n);i!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[i]=VOID,++this.pendingRemovals_[e]):(r.splice(i,1),r.length===0&&delete this.listeners_[e]))}}const EventType={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function listen(t,e,n,r,i){if(i){const y=n;n=function(){t.removeEventListener(e,n),y.apply(r??this,arguments)}}else r&&r!==t&&(n=n.bind(r));const g={target:t,type:e,listener:n};return t.addEventListener(e,n),g}function listenOnce(t,e,n,r){return listen(t,e,n,r,!0)}function unlistenByKey(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),clear(t))}class Observable extends Target{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(EventType.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const r=e.length,i=new Array(r);for(let g=0;g<r;++g)i[g]=listen(this,e[g],n);return i}return listen(this,e,n)}onceInternal(e,n){let r;if(Array.isArray(e)){const i=e.length;r=new Array(i);for(let g=0;g<i;++g)r[g]=listenOnce(this,e[g],n)}else r=listenOnce(this,e,n);return n.ol_key=r,r}unInternal(e,n){const r=n.ol_key;if(r)unByKey(r);else if(Array.isArray(e))for(let i=0,g=e.length;i<g;++i)this.removeEventListener(e[i],n);else this.removeEventListener(e,n)}}Observable.prototype.on,Observable.prototype.once,Observable.prototype.un;function unByKey(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)unlistenByKey(t[e]);else unlistenByKey(t)}function abstract(){throw new Error("Unimplemented abstract method.")}let uidCounter_=0;function getUid(t){return t.ol_uid||(t.ol_uid=String(++uidCounter_))}class ObjectEvent extends BaseEvent{constructor(e,n,r){super(e),this.key=n,this.oldValue=r}}class BaseObject extends Observable{constructor(e){super(),this.on,this.once,this.un,getUid(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let n;return this.values_&&this.values_.hasOwnProperty(e)&&(n=this.values_[e]),n}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,n){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n)),r=ObjectEventType.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n))}addChangeListener(e,n){this.addEventListener(`change:${e}`,n)}removeChangeListener(e,n){this.removeEventListener(`change:${e}`,n)}set(e,n,r){const i=this.values_||(this.values_={});if(r)i[e]=n;else{const g=i[e];i[e]=n,g!==n&&this.notify(e,g)}}setProperties(e,n){for(const r in e)this.set(r,e[r],n)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,n){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],isEmpty$1(this.values_)&&(this.values_=null),n||this.notify(e,r)}}}const CollectionEventType={ADD:"add",REMOVE:"remove"},Property$3={LENGTH:"length"};class CollectionEvent extends BaseEvent{constructor(e,n,r){super(e),this.element=n,this.index=r}}class Collection extends BaseObject{constructor(e,n){if(super(),this.on,this.once,this.un,n=n||{},this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(let r=0,i=this.array_.length;r<i;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let n=0,r=e.length;n<r;++n)this.push(e[n]);return this}forEach(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)e(n[r],r,n)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Property$3.LENGTH)}insertAt(e,n){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e)return this.removeAt(r)}removeAt(e){if(e<0||e>=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,n,e)),n}setAt(e,n){const r=this.getLength();if(e>=r){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const i=this.array_[e];this.array_[e]=n,this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,i,e)),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}updateLength_(){this.set(Property$3.LENGTH,this.array_.length)}assertUnique_(e,n){for(let r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===e&&r!==n)throw new Error("Duplicate item added to a unique collection")}}function quickselect(t,e,n=0,r=t.length-1,i=defaultCompare){for(;r>n;){if(r-n>600){const L=r-n+1,$=e-n+1,V=Math.log(L),z=.5*Math.exp(2*V/3),j=.5*Math.sqrt(V*z*(L-z)/L)*($-L/2<0?-1:1),oe=Math.max(n,Math.floor(e-$*z/L+j)),re=Math.min(r,Math.floor(e+(L-$)*z/L+j));quickselect(t,e,oe,re,i)}const g=t[e];let y=n,k=r;for(swap(t,n,e),i(t[r],g)>0&&swap(t,n,r);y<k;){for(swap(t,y,k),y++,k--;i(t[y],g)<0;)y++;for(;i(t[k],g)>0;)k--}i(t[n],g)===0?swap(t,n,k):(k++,swap(t,k,r)),k<=e&&(n=k+1),e<=k&&(r=k-1)}}function swap(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function defaultCompare(t,e){return t<e?-1:t>e?1:0}let RBush$1=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!intersects$1(e,n))return r;const i=this.toBBox,g=[];for(;n;){for(let y=0;y<n.children.length;y++){const k=n.children[y],L=n.leaf?i(k):k;intersects$1(e,L)&&(n.leaf?r.push(k):contains(e,L)?this._all(k,r):g.push(k))}n=g.pop()}return r}collides(e){let n=this.data;if(!intersects$1(e,n))return!1;const r=[];for(;n;){for(let i=0;i<n.children.length;i++){const g=n.children[i],y=n.leaf?this.toBBox(g):g;if(intersects$1(e,y)){if(n.leaf||contains(e,y))return!0;r.push(g)}}n=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);return this}let n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=createNode([]),this}remove(e,n){if(!e)return this;let r=this.data;const i=this.toBBox(e),g=[],y=[];let k,L,$;for(;r||g.length;){if(r||(r=g.pop(),L=g[g.length-1],k=y.pop(),$=!0),r.leaf){const V=findItem(e,r.children,n);if(V!==-1)return r.children.splice(V,1),g.push(r),this._condense(g),this}!$&&!r.leaf&&contains(r,i)?(g.push(r),y.push(k),k=0,L=r,r=r.children[0]):L?(k++,r=L.children[k],$=!1):r=null}return this}toBBox(e){return e}compareMinX(e,n){return e.minX-n.minX}compareMinY(e,n){return e.minY-n.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,n){const r=[];for(;e;)e.leaf?n.push(...e.children):r.push(...e.children),e=r.pop();return n}_build(e,n,r,i){const g=r-n+1;let y=this._maxEntries,k;if(g<=y)return k=createNode(e.slice(n,r+1)),calcBBox(k,this.toBBox),k;i||(i=Math.ceil(Math.log(g)/Math.log(y)),y=Math.ceil(g/Math.pow(y,i-1))),k=createNode([]),k.leaf=!1,k.height=i;const L=Math.ceil(g/y),$=L*Math.ceil(Math.sqrt(y));multiSelect(e,n,r,$,this.compareMinX);for(let V=n;V<=r;V+=$){const z=Math.min(V+$-1,r);multiSelect(e,V,z,L,this.compareMinY);for(let j=V;j<=z;j+=L){const oe=Math.min(j+L-1,z);k.children.push(this._build(e,j,oe,i-1))}}return calcBBox(k,this.toBBox),k}_chooseSubtree(e,n,r,i){for(;i.push(n),!(n.leaf||i.length-1===r);){let g=1/0,y=1/0,k;for(let L=0;L<n.children.length;L++){const $=n.children[L],V=bboxArea($),z=enlargedArea(e,$)-V;z<y?(y=z,g=V<g?V:g,k=$):z===y&&V<g&&(g=V,k=$)}n=k||n.children[0]}return n}_insert(e,n,r){const i=r?e:this.toBBox(e),g=[],y=this._chooseSubtree(i,this.data,n,g);for(y.children.push(e),extend$2(y,i);n>=0&&g[n].children.length>this._maxEntries;)this._split(g,n),n--;this._adjustParentBBoxes(i,g,n)}_split(e,n){const r=e[n],i=r.children.length,g=this._minEntries;this._chooseSplitAxis(r,g,i);const y=this._chooseSplitIndex(r,g,i),k=createNode(r.children.splice(y,r.children.length-y));k.height=r.height,k.leaf=r.leaf,calcBBox(r,this.toBBox),calcBBox(k,this.toBBox),n?e[n-1].children.push(k):this._splitRoot(r,k)}_splitRoot(e,n){this.data=createNode([e,n]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,g=1/0,y=1/0;for(let k=n;k<=r-n;k++){const L=distBBox(e,0,k,this.toBBox),$=distBBox(e,k,r,this.toBBox),V=intersectionArea(L,$),z=bboxArea(L)+bboxArea($);V<g?(g=V,i=k,y=z<y?z:y):V===g&&z<y&&(y=z,i=k)}return i||r-n}_chooseSplitAxis(e,n,r){const i=e.leaf?this.compareMinX:compareNodeMinX,g=e.leaf?this.compareMinY:compareNodeMinY,y=this._allDistMargin(e,n,r,i),k=this._allDistMargin(e,n,r,g);y<k&&e.children.sort(i)}_allDistMargin(e,n,r,i){e.children.sort(i);const g=this.toBBox,y=distBBox(e,0,n,g),k=distBBox(e,r-n,r,g);let L=bboxMargin(y)+bboxMargin(k);for(let $=n;$<r-n;$++){const V=e.children[$];extend$2(y,e.leaf?g(V):V),L+=bboxMargin(y)}for(let $=r-n-1;$>=n;$--){const V=e.children[$];extend$2(k,e.leaf?g(V):V),L+=bboxMargin(k)}return L}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)extend$2(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():calcBBox(e[n],this.toBBox)}};function findItem(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function calcBBox(t,e){distBBox(t,0,t.children.length,e,t)}function distBBox(t,e,n,r,i){i||(i=createNode(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let g=e;g<n;g++){const y=t.children[g];extend$2(i,t.leaf?r(y):y)}return i}function extend$2(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function compareNodeMinX(t,e){return t.minX-e.minX}function compareNodeMinY(t,e){return t.minY-e.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function intersectionArea(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),g=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,g-r)}function contains(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function intersects$1(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,e,n,r,i){const g=[e,n];for(;g.length;){if(n=g.pop(),e=g.pop(),n-e<=r)continue;const y=e+Math.ceil((n-e)/r/2)*r;quickselect(t,y,e,n,i),g.push(e,y,y,n)}}const Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function boundingExtent(t){const e=createEmpty();for(let n=0,r=t.length;n<r;++n)extendCoordinate(e,t[n]);return e}function _boundingExtentXYs(t,e,n){const r=Math.min.apply(null,t),i=Math.min.apply(null,e),g=Math.max.apply(null,t),y=Math.max.apply(null,e);return createOrUpdate$2(r,i,g,y,n)}function buffer(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function clone$1(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function closestSquaredDistanceXY(t,e,n){let r,i;return e<t[0]?r=t[0]-e:t[2]<e?r=e-t[2]:r=0,n<t[1]?i=t[1]-n:t[3]<n?i=n-t[3]:i=0,r*r+i*i}function containsCoordinate(t,e){return containsXY(t,e[0],e[1])}function containsExtent(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function containsXY(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function coordinateRelationship(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=e[0],k=e[1];let L=Relationship.UNKNOWN;return y<n?L=L|Relationship.LEFT:y>i&&(L=L|Relationship.RIGHT),k<r?L=L|Relationship.BELOW:k>g&&(L=L|Relationship.ABOVE),L===Relationship.UNKNOWN&&(L=Relationship.INTERSECTING),L}function createEmpty(){return[1/0,1/0,-1/0,-1/0]}function createOrUpdate$2(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function createOrUpdateEmpty(t){return createOrUpdate$2(1/0,1/0,-1/0,-1/0,t)}function createOrUpdateFromCoordinate(t,e){const n=t[0],r=t[1];return createOrUpdate$2(n,r,n,r,e)}function createOrUpdateFromFlatCoordinates(t,e,n,r,i){const g=createOrUpdateEmpty(i);return extendFlatCoordinates(g,t,e,n,r)}function equals$1(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function extend$1(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function extendCoordinate(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function extendFlatCoordinates(t,e,n,r,i){for(;n<r;n+=i)extendXY(t,e[n],e[n+1]);return t}function extendXY(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function forEachCorner(t,e){let n;return n=e(getBottomLeft(t)),n||(n=e(getBottomRight(t)),n)||(n=e(getTopRight(t)),n)||(n=e(getTopLeft(t)),n)?n:!1}function getArea$1(t){let e=0;return isEmpty(t)||(e=getWidth(t)*getHeight(t)),e}function getBottomLeft(t){return[t[0],t[1]]}function getBottomRight(t){return[t[2],t[1]]}function getCenter(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function getCorner(t,e){let n;if(e==="bottom-left")n=getBottomLeft(t);else if(e==="bottom-right")n=getBottomRight(t);else if(e==="top-left")n=getTopLeft(t);else if(e==="top-right")n=getTopRight(t);else throw new Error("Invalid corner");return n}function getForViewAndSize(t,e,n,r,i){const[g,y,k,L,$,V,z,j]=getRotatedViewport(t,e,n,r);return createOrUpdate$2(Math.min(g,k,$,z),Math.min(y,L,V,j),Math.max(g,k,$,z),Math.max(y,L,V,j),i)}function getRotatedViewport(t,e,n,r){const i=e*r[0]/2,g=e*r[1]/2,y=Math.cos(n),k=Math.sin(n),L=i*y,$=i*k,V=g*y,z=g*k,j=t[0],oe=t[1];return[j-L+z,oe-$-V,j-L-z,oe-$+V,j+L-z,oe+$+V,j+L+z,oe+$-V,j-L+z,oe-$-V]}function getHeight(t){return t[3]-t[1]}function getIntersection(t,e,n){const r=createEmpty();return intersects(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):createOrUpdateEmpty(r),r}function getTopLeft(t){return[t[0],t[3]]}function getTopRight(t){return[t[2],t[3]]}function getWidth(t){return t[2]-t[0]}function intersects(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function isEmpty(t){return t[2]<t[0]||t[3]<t[1]}function returnOrUpdate(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function intersectsSegment(t,e,n){let r=!1;const i=coordinateRelationship(t,e),g=coordinateRelationship(t,n);if(i===Relationship.INTERSECTING||g===Relationship.INTERSECTING)r=!0;else{const y=t[0],k=t[1],L=t[2],$=t[3],V=e[0],z=e[1],j=n[0],oe=n[1],re=(oe-z)/(j-V);let ie,ae;g&Relationship.ABOVE&&!(i&Relationship.ABOVE)&&(ie=j-(oe-$)/re,r=ie>=y&&ie<=L),!r&&g&Relationship.RIGHT&&!(i&Relationship.RIGHT)&&(ae=oe-(j-L)*re,r=ae>=k&&ae<=$),!r&&g&Relationship.BELOW&&!(i&Relationship.BELOW)&&(ie=j-(oe-k)/re,r=ie>=y&&ie<=L),!r&&g&Relationship.LEFT&&!(i&Relationship.LEFT)&&(ae=oe-(j-y)*re,r=ae>=k&&ae<=$)}return r}function applyTransform(t,e,n,r){if(isEmpty(t))return createOrUpdateEmpty(n);let i=[];i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);const g=[],y=[];for(let k=0,L=i.length;k<L;k+=2)g.push(i[k]),y.push(i[k+1]);return _boundingExtentXYs(g,y,n)}function wrapX$2(t,e){const n=e.getExtent(),r=getCenter(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){const i=getWidth(n),y=Math.floor((r[0]-n[0])/i)*i;t[0]-=y,t[2]-=y}return t}function wrapAndSliceX(t,e,n){if(e.canWrapX()){const r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];wrapX$2(t,e);const i=getWidth(r);if(getWidth(t)>i&&!n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+i,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-i,t[3]]]}return[t]}class RBush{constructor(e){this.rbush_=new RBush$1(e),this.items_={}}insert(e,n){const r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:n};this.rbush_.insert(r),this.items_[getUid(n)]=r}load(e,n){const r=new Array(n.length);for(let i=0,g=n.length;i<g;i++){const y=e[i],k=n[i],L={minX:y[0],minY:y[1],maxX:y[2],maxY:y[3],value:k};r[i]=L,this.items_[getUid(k)]=L}this.rbush_.load(r)}remove(e){const n=getUid(e),r=this.items_[n];return delete this.items_[n],this.rbush_.remove(r)!==null}update(e,n){const r=this.items_[getUid(n)],i=[r.minX,r.minY,r.maxX,r.maxY];equals$1(i,e)||(this.remove(n),this.insert(e,n))}getAll(){return this.rbush_.all().map(function(n){return n.value})}getInExtent(e){const n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(n).map(function(i){return i.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,n){return this.forEach_(this.getInExtent(e),n)}forEach_(e,n){let r;for(let i=0,g=e.length;i<g;i++)if(r=n(e[i]),r)return r;return r}isEmpty(){return isEmpty$1(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const n=this.rbush_.toJSON();return createOrUpdate$2(n.minX,n.minY,n.maxX,n.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const n in e.items_)this.items_[n]=e.items_[n]}}function assert(t,e){if(!t)throw new Error(e)}class Feature extends BaseObject{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new Feature(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=listen(e,EventType.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?createStyleFunction(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function createStyleFunction(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(assert(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}const tmp_=new Array(6);function create$2(){return[1,0,0,1,0,0]}function multiply(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=t[4],k=t[5],L=e[0],$=e[1],V=e[2],z=e[3],j=e[4],oe=e[5];return t[0]=n*L+i*$,t[1]=r*L+g*$,t[2]=n*V+i*z,t[3]=r*V+g*z,t[4]=n*j+i*oe+y,t[5]=r*j+g*oe+k,t}function set(t,e,n,r,i,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=g,t[5]=y,t}function setFromArray(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function apply(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function translate$2(t,e,n){return multiply(t,set(tmp_,1,0,0,1,e,n))}function compose(t,e,n,r,i,g,y,k){const L=Math.sin(g),$=Math.cos(g);return t[0]=r*$,t[1]=i*L,t[2]=-r*L,t[3]=i*$,t[4]=y*r*$-k*r*L+e,t[5]=y*i*L+k*i*$+n,t}function makeInverse(t,e){const n=determinant(e);assert(n!==0,"Transformation matrix cannot be inverted");const r=e[0],i=e[1],g=e[2],y=e[3],k=e[4],L=e[5];return t[0]=y/n,t[1]=-i/n,t[2]=-g/n,t[3]=r/n,t[4]=(g*L-y*k)/n,t[5]=-(r*L-i*k)/n,t}function determinant(t){return t[0]*t[3]-t[1]*t[2]}const matrixPrecision=[1e6,1e6,1e6,1e6,2,2];function toString$1(t){return"matrix("+t.map((n,r)=>Math.round(n*matrixPrecision[r])/matrixPrecision[r]).join(", ")+")"}const METERS_PER_UNIT$1={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Projection{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||METERS_PER_UNIT$1[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const RADIUS$1=6378137,HALF_SIZE=Math.PI*RADIUS$1,EXTENT$1=[-HALF_SIZE,-HALF_SIZE,HALF_SIZE,HALF_SIZE],WORLD_EXTENT=[-180,-85,180,85],MAX_SAFE_Y=RADIUS$1*Math.log(Math.tan(Math.PI/2));class EPSG3857Projection extends Projection{constructor(e){super({code:e,units:"m",extent:EXTENT$1,global:!0,worldExtent:WORLD_EXTENT,getPointResolution:function(n,r){return n/Math.cosh(r[1]/RADIUS$1)}})}}const PROJECTIONS$1=[new EPSG3857Projection("EPSG:3857"),new EPSG3857Projection("EPSG:102100"),new EPSG3857Projection("EPSG:102113"),new EPSG3857Projection("EPSG:900913"),new EPSG3857Projection("http://www.opengis.net/def/crs/EPSG/0/3857"),new EPSG3857Projection("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fromEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r){e[g]=HALF_SIZE*t[g]/180;let y=RADIUS$1*Math.log(Math.tan(Math.PI*(+t[g+1]+90)/360));y>MAX_SAFE_Y?y=MAX_SAFE_Y:y<-MAX_SAFE_Y&&(y=-MAX_SAFE_Y),e[g+1]=y}return e}function toEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r)e[g]=180*t[g]/HALF_SIZE,e[g+1]=360*Math.atan(Math.exp(t[g+1]/RADIUS$1))/Math.PI-90;return e}const RADIUS=6378137,EXTENT=[-180,-90,180,90],METERS_PER_UNIT=Math.PI*RADIUS/180;class EPSG4326Projection extends Projection{constructor(e,n){super({code:e,units:"degrees",extent:EXTENT,axisOrientation:n,global:!0,metersPerUnit:METERS_PER_UNIT,worldExtent:EXTENT})}}const PROJECTIONS=[new EPSG4326Projection("CRS:84"),new EPSG4326Projection("EPSG:4326","neu"),new EPSG4326Projection("urn:ogc:def:crs:OGC:1.3:CRS84"),new EPSG4326Projection("urn:ogc:def:crs:OGC:2:84"),new EPSG4326Projection("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new EPSG4326Projection("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new EPSG4326Projection("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let cache$1={};function get$3(t){return cache$1[t]||cache$1[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function add$2(t,e){cache$1[t]=e}let transforms={};function add$1(t,e,n){const r=t.getCode(),i=e.getCode();r in transforms||(transforms[r]={}),transforms[r][i]=n}function get$2(t,e){return t in transforms&&e in transforms[t]?transforms[t][e]:null}function clamp(t,e,n){return Math.min(Math.max(t,e),n)}function squaredSegmentDistance(t,e,n,r,i,g){const y=i-n,k=g-r;if(y!==0||k!==0){const L=((t-n)*y+(e-r)*k)/(y*y+k*k);L>1?(n=i,r=g):L>0&&(n+=y*L,r+=k*L)}return squaredDistance$1(t,e,n,r)}function squaredDistance$1(t,e,n,r){const i=n-t,g=r-e;return i*i+g*g}function solveLinearSystem(t){const e=t.length;for(let r=0;r<e;r++){let i=r,g=Math.abs(t[r][r]);for(let k=r+1;k<e;k++){const L=Math.abs(t[k][r]);L>g&&(g=L,i=k)}if(g===0)return null;const y=t[i];t[i]=t[r],t[r]=y;for(let k=r+1;k<e;k++){const L=-t[k][r]/t[r][r];for(let $=r;$<e+1;$++)r==$?t[k][$]=0:t[k][$]+=L*t[r][$]}}const n=new Array(e);for(let r=e-1;r>=0;r--){n[r]=t[r][e]/t[r][r];for(let i=r-1;i>=0;i--)t[i][e]-=t[i][r]*n[r]}return n}function toDegrees(t){return t*180/Math.PI}function toRadians(t){return t*Math.PI/180}function modulo(t,e){const n=t%e;return n*e<0?n+e:n}function lerp(t,e,n){return t+n*(e-t)}function toFixed(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function floor(t,e){return Math.floor(toFixed(t,e))}function ceil(t,e){return Math.ceil(toFixed(t,e))}function wrap(t,e,n){if(t>=e&&t<n)return t;const r=n-e;return((t-e)%r+r)%r+e}function add(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function equals(t,e){let n=!0;for(let r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function rotate$1(t,e){const n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,g=t[1]*n+t[0]*r;return t[0]=i,t[1]=g,t}function scale$3(t,e){return t[0]*=e,t[1]*=e,t}function squaredDistance(t,e){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function distance$1(t,e){return Math.sqrt(squaredDistance(t,e))}function wrapX$1(t,e){if(e.canWrapX()){const n=getWidth(e.getExtent()),r=getWorldsAway(t,e,n);r&&(t[0]-=r*n)}return t}function getWorldsAway(t,e,n){const r=e.getExtent();let i=0;return e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])&&(n=n||getWidth(r),i=Math.floor((t[0]-r[0])/n)),i}const DEFAULT_RADIUS=63710088e-1;function getDistance(t,e,n){n=n||DEFAULT_RADIUS;const r=toRadians(t[1]),i=toRadians(e[1]),g=(i-r)/2,y=toRadians(e[0]-t[0])/2,k=Math.sin(g)*Math.sin(g)+Math.sin(y)*Math.sin(y)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(k),Math.sqrt(1-k))}function getLengthInternal(t,e){let n=0;for(let r=0,i=t.length;r<i-1;++r)n+=getDistance(t[r],t[r+1],e);return n}function getLength(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{y=t.getCoordinates(),g=getLengthInternal(y,n);break}case"MultiLineString":case"Polygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)g+=getLengthInternal(y[L],n);break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],V=0,z=k.length;V<z;++V)g+=getLengthInternal(k[V],n);break}case"GeometryCollection":{const j=t.getGeometries();for(L=0,$=j.length;L<$;++L)g+=getLength(j[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}function getAreaInternal(t,e){let n=0;const r=t.length;let i=t[r-1][0],g=t[r-1][1];for(let y=0;y<r;y++){const k=t[y][0],L=t[y][1];n+=toRadians(k-i)*(2+Math.sin(toRadians(g))+Math.sin(toRadians(L))),i=k,g=L}return n*e*e/2}function getArea(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(y=t.getCoordinates(),g=Math.abs(getAreaInternal(y[0],n)),L=1,$=y.length;L<$;++L)g-=Math.abs(getAreaInternal(y[L],n));break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],g+=Math.abs(getAreaInternal(k[0],n)),V=1,z=k.length;V<z;++V)g-=Math.abs(getAreaInternal(k[V],n));break}case"GeometryCollection":{const j=t.getGeometries();for(L=0,$=j.length;L<$;++L)g+=getArea(j[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}const K0=.9996,E=.00669438,E2=E*E,E3=E2*E,E_P2=E/(1-E),SQRT_E=Math.sqrt(1-E),_E=(1-SQRT_E)/(1+SQRT_E),_E2=_E*_E,_E3=_E2*_E,_E4=_E3*_E,_E5=_E4*_E,M1=1-E/4-3*E2/64-5*E3/256,M2=3*E/8+3*E2/32+45*E3/1024,M3=15*E2/256+45*E3/1024,M4=35*E3/3072,P2=3/2*_E-27/32*_E3+269/512*_E5,P3=21/16*_E2-55/32*_E4,P4=151/96*_E3-417/128*_E5,P5=1097/512*_E4,R=6378137;function toLonLat$1(t,e,n){const r=t-5e5,y=(n.north?e:e-1e7)/K0/(R*M1),k=y+P2*Math.sin(2*y)+P3*Math.sin(4*y)+P4*Math.sin(6*y)+P5*Math.sin(8*y),L=Math.sin(k),$=L*L,V=Math.cos(k),z=L/V,j=z*z,oe=j*j,re=1-E*$,ie=Math.sqrt(1-E*$),ae=R/ie,le=(1-E)/re,de=E_P2*V**2,pe=de*de,ue=r/(ae*K0),he=ue*ue,Ce=he*ue,_e=Ce*ue,xe=_e*ue,Ie=xe*ue,Oe=k-z/le*(he/2-_e/24*(5+3*j+10*de-4*pe-9*E_P2))+Ie/720*(61+90*j+298*de+45*oe-252*E_P2-3*pe);let $e=(ue-Ce/6*(1+2*j+de)+xe/120*(5-2*de+28*j-3*pe+8*E_P2+24*oe))/V;return $e=wrap($e+toRadians(zoneToCentralLongitude(n.number)),-Math.PI,Math.PI),[toDegrees($e),toDegrees(Oe)]}const MIN_LATITUDE=-80,MAX_LATITUDE=84,MIN_LONGITUDE=-180,MAX_LONGITUDE=180;function fromLonLat$1(t,e,n){t=wrap(t,MIN_LONGITUDE,MAX_LONGITUDE),e<MIN_LATITUDE?e=MIN_LATITUDE:e>MAX_LATITUDE&&(e=MAX_LATITUDE);const r=toRadians(e),i=Math.sin(r),g=Math.cos(r),y=i/g,k=y*y,L=k*k,$=toRadians(t),V=zoneToCentralLongitude(n.number),z=toRadians(V),j=R/Math.sqrt(1-E*i**2),oe=E_P2*g**2,re=g*wrap($-z,-Math.PI,Math.PI),ie=re*re,ae=ie*re,le=ae*re,de=le*re,pe=de*re,ue=R*(M1*r-M2*Math.sin(2*r)+M3*Math.sin(4*r)-M4*Math.sin(6*r)),he=K0*j*(re+ae/6*(1-k+oe)+de/120*(5-18*k+L+72*oe-58*E_P2))+5e5;let Ce=K0*(ue+j*y*(ie/2+le/24*(5-k+9*oe+4*oe**2)+pe/720*(61-58*k+L+600*oe-330*E_P2)));return n.north||(Ce+=1e7),[he,Ce]}function zoneToCentralLongitude(t){return(t-1)*6-180+3}const epsgRegExes=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function zoneFromCode(t){let e=0;for(const i of epsgRegExes){const g=t.match(i);if(g){e=parseInt(g[1]);break}}if(!e)return null;let n=0,r=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(r=!0,n=e-32600),n?{number:n,north:r}:null}function makeTransformFunction(t,e){return function(n,r,i,g){const y=n.length;i=i>1?i:2,g=g??i,r||(i>2?r=n.slice():r=new Array(y));for(let k=0;k<y;k+=g){const L=n[k],$=n[k+1],V=t(L,$,e);r[k]=V[0],r[k+1]=V[1]}return r}}function makeProjection(t){return zoneFromCode(t)?new Projection({code:t,units:"m"}):null}function makeTransforms(t){const e=zoneFromCode(t.getCode());return e?{forward:makeTransformFunction(fromLonLat$1,e),inverse:makeTransformFunction(toLonLat$1,e)}:null}function warn(...t){console.warn(...t)}const transformFactories=[makeTransforms],projectionFactories=[makeProjection];let showCoordinateWarning=!0;function disableCoordinateWarning(t){showCoordinateWarning=!1}function cloneTransform(t,e){if(e!==void 0){for(let n=0,r=t.length;n<r;++n)e[n]=t[n];e=e}else e=t.slice();return e}function addProjection(t){add$2(t.getCode(),t),add$1(t,t,cloneTransform)}function addProjections(t){t.forEach(addProjection)}function get$1(t){if(typeof t!="string")return t;const e=get$3(t);if(e)return e;for(const n of projectionFactories){const r=n(t);if(r)return r}return null}function getPointResolution(t,e,n,r){t=get$1(t);let i;const g=t.getPointResolutionFunc();if(g){if(i=g(e,n),r&&r!==t.getUnits()){const y=t.getMetersPerUnit();y&&(i=i*y/METERS_PER_UNIT$1[r])}}else{const y=t.getUnits();if(y=="degrees"&&!r||r=="degrees")i=e;else{const k=getTransformFromProjections(t,get$1("EPSG:4326"));if(!k&&y!=="degrees")i=e*t.getMetersPerUnit();else{let $=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];$=k($,$,2);const V=getDistance($.slice(0,2),$.slice(2,4)),z=getDistance($.slice(4,6),$.slice(6,8));i=(V+z)/2}const L=r?METERS_PER_UNIT$1[r]:t.getMetersPerUnit();L!==void 0&&(i/=L)}}return i}function addEquivalentProjections(t){addProjections(t),t.forEach(function(e){t.forEach(function(n){e!==n&&add$1(e,n,cloneTransform)})})}function addEquivalentTransforms(t,e,n,r){t.forEach(function(i){e.forEach(function(g){add$1(i,g,n),add$1(g,i,r)})})}function createProjection(t,e){return t?typeof t=="string"?get$1(t):t:get$1(e)}function createTransformFromCoordinateTransform(t){return function(e,n,r,i){const g=e.length;r=r!==void 0?r:2,i=i??r,n=n!==void 0?n:new Array(g);for(let y=0;y<g;y+=i){const k=t(e.slice(y,y+r)),L=k.length;for(let $=0,V=i;$<V;++$)n[y+$]=$>=L?e[y+$]:k[$]}return n}}function fromLonLat(t,e){return disableCoordinateWarning(),transform(t,"EPSG:4326","EPSG:3857")}function toLonLat(t,e){const n=transform(t,"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=modulo(r+180,360)-180),n}function equivalent(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||getTransformFromProjections(t,e)===cloneTransform)&&n}function getTransformFromProjections(t,e){const n=t.getCode(),r=e.getCode();let i=get$2(n,r);if(i)return i;let g=null,y=null;for(const L of transformFactories)g||(g=L(t)),y||(y=L(e));if(!g&&!y)return null;const k="EPSG:4326";if(y)if(g)i=composeTransformFuncs(g.inverse,y.forward);else{const L=get$2(n,k);L&&(i=composeTransformFuncs(L,y.forward))}else{const L=get$2(k,r);L&&(i=composeTransformFuncs(g.inverse,L))}return i&&(addProjection(t),addProjection(e),add$1(t,e,i)),i}function composeTransformFuncs(t,e){return function(n,r,i,g){return r=t(n,r,i,g),e(r,r,i,g)}}function getTransform(t,e){const n=get$1(t),r=get$1(e);return getTransformFromProjections(n,r)}function transform(t,e,n){const r=getTransform(e,n);if(!r){const i=get$1(e).getCode(),g=get$1(n).getCode();throw new Error(`No transform available between ${i} and ${g}`)}return r(t,void 0,t.length)}function transformExtent(t,e,n,r){const i=getTransform(e,n);return applyTransform(t,i,void 0)}function toUserCoordinate(t,e){return t}function fromUserCoordinate(t,e){return showCoordinateWarning&&!equals(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(showCoordinateWarning=!1,warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function toUserExtent(t,e){return t}function fromUserExtent(t,e){return t}function addCommon(){addEquivalentProjections(PROJECTIONS$1),addEquivalentProjections(PROJECTIONS),addEquivalentTransforms(PROJECTIONS,PROJECTIONS$1,fromEPSG4326,toEPSG4326)}addCommon();function transform2D(t,e,n,r,i,g,y){g=g||[],y=y||2;let k=0;for(let L=e;L<n;L+=r){const $=t[L],V=t[L+1];g[k++]=i[0]*$+i[2]*V+i[4],g[k++]=i[1]*$+i[3]*V+i[5];for(let z=2;z<y;z++)g[k++]=t[L+z]}return g&&g.length!=k&&(g.length=k),g}function rotate(t,e,n,r,i,g,y){y=y||[];const k=Math.cos(i),L=Math.sin(i),$=g[0],V=g[1];let z=0;for(let j=e;j<n;j+=r){const oe=t[j]-$,re=t[j+1]-V;y[z++]=$+oe*k-re*L,y[z++]=V+oe*L+re*k;for(let ie=j+2;ie<j+r;++ie)y[z++]=t[ie]}return y&&y.length!=z&&(y.length=z),y}function scale$2(t,e,n,r,i,g,y,k){k=k||[];const L=y[0],$=y[1];let V=0;for(let z=e;z<n;z+=r){const j=t[z]-L,oe=t[z+1]-$;k[V++]=L+i*j,k[V++]=$+g*oe;for(let re=z+2;re<z+r;++re)k[V++]=t[re]}return k&&k.length!=V&&(k.length=V),k}function translate$1(t,e,n,r,i,g,y){y=y||[];let k=0;for(let L=e;L<n;L+=r){y[k++]=t[L]+i,y[k++]=t[L+1]+g;for(let $=L+2;$<L+r;++$)y[k++]=t[$]}return y&&y.length!=k&&(y.length=k),y}const tmpTransform$1=create$2();class Geometry extends BaseObject{constructor(){super(),this.extent_=createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=memoizeOne((e,n,r)=>{if(!r)return this.getSimplifiedGeometry(n);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return abstract()}closestPointXY(e,n,r,i){return abstract()}containsXY(e,n){const r=this.getClosestPoint([e,n]);return r[0]===e&&r[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return abstract()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&createOrUpdateEmpty(n),this.extentRevision_=this.getRevision()}return returnOrUpdate(this.extent_,e)}rotate(e,n){abstract()}scale(e,n,r){abstract()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return abstract()}getType(){return abstract()}applyTransform(e){abstract()}intersectsExtent(e){return abstract()}translate(e,n){abstract()}transform(e,n){const r=get$1(e),i=r.getUnits()=="tile-pixels"?function(g,y,k){const L=r.getExtent(),$=r.getWorldExtent(),V=getHeight($)/getHeight(L);compose(tmpTransform$1,$[0],$[3],V,-V,0,0,0);const z=transform2D(g,0,g.length,k,tmpTransform$1,y),j=getTransform(r,n);return j?j(z,z,k):z}:getTransform(r,n);return this.applyTransform(i),this}}class SimpleGeometry extends Geometry{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return abstract()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,n){this.stride=getStrideForLayout(e),this.layout=e,this.flatCoordinates=n}setCoordinates(e,n){abstract()}setLayout(e,n,r){let i;if(e)i=getStrideForLayout(e);else{for(let g=0;g<r;++g){if(n.length===0){this.layout="XY",this.stride=2;return}n=n[0]}i=n.length,e=getLayoutForStride(i)}this.layout=e,this.stride=i}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();rotate(r,0,r.length,i,e,n,r),this.changed()}}scale(e,n,r){n===void 0&&(n=e),r||(r=getCenter(this.getExtent()));const i=this.getFlatCoordinates();if(i){const g=this.getStride();scale$2(i,0,i.length,g,e,n,r,i),this.changed()}}translate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();translate$1(r,0,r.length,i,e,n,r),this.changed()}}}function getLayoutForStride(t){let e;return t==2?e="XY":t==3?e="XYZ":t==4&&(e="XYZM"),e}function getStrideForLayout(t){let e;return t=="XY"?e=2:t=="XYZ"||t=="XYM"?e=3:t=="XYZM"&&(e=4),e}function transformGeom2D(t,e,n){const r=t.getFlatCoordinates();if(!r)return null;const i=t.getStride();return transform2D(r,0,r.length,i,e,n)}function deflateCoordinate(t,e,n,r){for(let i=0,g=n.length;i<g;++i)t[e++]=n[i];return e}function deflateCoordinates(t,e,n,r){for(let i=0,g=n.length;i<g;++i){const y=n[i];for(let k=0;k<r;++k)t[e++]=y[k]}return e}function deflateCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinates(t,e,n[y],r);i[g++]=L,e=L}return i.length=g,i}function deflateMultiCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinatesArray(t,e,n[y],r,i[g]);L.length===0&&(L[0]=e),i[g++]=L,e=L[L.length-1]}return i.length=g,i}class Circle extends SimpleGeometry{constructor(e,n,r){super(),r!==void 0&&n===void 0?this.setFlatCoordinates(r,e):(n=n||0,this.setCenterAndRadius(e,n,r))}clone(){const e=new Circle(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=e-g[0],k=n-g[1],L=y*y+k*k;if(L<i){if(L===0)for(let $=0;$<this.stride;++$)r[$]=g[$];else{const $=this.getRadius()/Math.sqrt(L);r[0]=g[0]+$*y,r[1]=g[1]+$*k;for(let V=2;V<this.stride;++V)r[V]=g[V]}return r.length=this.stride,L}return i}containsXY(e,n){const r=this.flatCoordinates,i=e-r[0],g=n-r[1];return i*i+g*g<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const n=this.flatCoordinates,r=n[this.stride]-n[0];return createOrUpdate$2(n[0]-r,n[1]-r,n[0]+r,n[1]+r,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],n=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+n*n}getType(){return"Circle"}intersectsExtent(e){const n=this.getExtent();if(intersects(e,n)){const r=this.getCenter();return e[0]<=r[0]&&e[2]>=r[0]||e[1]<=r[1]&&e[3]>=r[1]?!0:forEachCorner(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const n=this.stride,r=this.flatCoordinates[n]-this.flatCoordinates[0],i=e.slice();i[n]=i[0]+r;for(let g=1;g<n;++g)i[n+g]=e[g];this.setFlatCoordinates(this.layout,i),this.changed()}setCenterAndRadius(e,n,r){this.setLayout(r,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const i=this.flatCoordinates;let g=deflateCoordinate(i,0,e,this.stride);i[g++]=i[0]+n;for(let y=1,k=this.stride;y<k;++y)i[g++]=i[y];i.length=g,this.changed()}getCoordinates(){return null}setCoordinates(e,n){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,n){const r=this.getCenter(),i=this.getStride();this.setCenter(rotate(r,0,r.length,i,e,n,r)),this.changed()}}Circle.prototype.transform;class GeometryCollection extends Geometry{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(unlistenByKey),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)this.changeEventsKeys_.push(listen(e[n],EventType.CHANGE,this.changed,this))}clone(){const e=new GeometryCollection(cloneGeometries(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,n,r,i){if(i<closestSquaredDistanceXY(this.getExtent(),e,n))return i;const g=this.geometries_;for(let y=0,k=g.length;y<k;++y)i=g[y].closestPointXY(e,n,r,i);return i}containsXY(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)if(r[i].containsXY(e,n))return!0;return!1}computeExtent(e){createOrUpdateEmpty(e);const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)extend$1(e,n[r].getExtent());return e}getGeometries(){return cloneGeometries(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].getType()===this.getType()?e=e.concat(n[r].getGeometriesArrayRecursive()):e.push(n[r]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=[],r=this.geometries_;let i=!1;for(let g=0,y=r.length;g<y;++g){const k=r[g],L=k.getSimplifiedGeometry(e);n.push(L),L!==k&&(i=!0)}return i?new GeometryCollection(n):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)r[i].rotate(e,n);this.changed()}scale(e,n,r){r||(r=getCenter(this.getExtent()));const i=this.geometries_;for(let g=0,y=i.length;g<y;++g)i[g].scale(e,n,r);this.changed()}setGeometries(e){this.setGeometriesArray(cloneGeometries(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].applyTransform(e);this.changed()}translate(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)r[i].translate(e,n);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function cloneGeometries(t){return t.map(e=>e.clone())}function assignClosest(t,e,n,r,i,g,y){const k=t[e],L=t[e+1],$=t[n]-k,V=t[n+1]-L;let z;if($===0&&V===0)z=e;else{const j=((i-k)*$+(g-L)*V)/($*$+V*V);if(j>1)z=n;else if(j>0){for(let oe=0;oe<r;++oe)y[oe]=lerp(t[e+oe],t[n+oe],j);y.length=r;return}else z=e}for(let j=0;j<r;++j)y[j]=t[z+j];y.length=r}function maxSquaredDelta(t,e,n,r,i){let g=t[e],y=t[e+1];for(e+=r;e<n;e+=r){const k=t[e],L=t[e+1],$=squaredDistance$1(g,y,k,L);$>i&&(i=$),g=k,y=L}return i}function arrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=maxSquaredDelta(t,e,k,r,i),e=k}return i}function multiArrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=arrayMaxSquaredDelta(t,e,k,r,i),e=k[k.length-1]}return i}function assignClosestPoint(t,e,n,r,i,g,y,k,L,$,V){if(e==n)return $;let z,j;if(i===0){if(j=squaredDistance$1(y,k,t[e],t[e+1]),j<$){for(z=0;z<r;++z)L[z]=t[e+z];return L.length=r,j}return $}V=V||[NaN,NaN];let oe=e+r;for(;oe<n;)if(assignClosest(t,oe-r,oe,r,y,k,V),j=squaredDistance$1(y,k,V[0],V[1]),j<$){for($=j,z=0;z<r;++z)L[z]=V[z];L.length=r,oe+=r}else oe+=r*Math.max((Math.sqrt(j)-Math.sqrt($))/i|0,1);if(g&&(assignClosest(t,n-r,e,r,y,k,V),j=squaredDistance$1(y,k,V[0],V[1]),j<$)){for($=j,z=0;z<r;++z)L[z]=V[z];L.length=r}return $}function assignClosestArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,j=n.length;z<j;++z){const oe=n[z];$=assignClosestPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe}return $}function assignClosestMultiArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,j=n.length;z<j;++z){const oe=n[z];$=assignClosestArrayPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe[oe.length-1]}return $}function douglasPeucker(t,e,n,r,i,g,y){const k=(n-e)/r;if(k<3){for(;e<n;e+=r)g[y++]=t[e],g[y++]=t[e+1];return y}const L=new Array(k);L[0]=1,L[k-1]=1;const $=[e,n-r];let V=0;for(;$.length>0;){const z=$.pop(),j=$.pop();let oe=0;const re=t[j],ie=t[j+1],ae=t[z],le=t[z+1];for(let de=j+r;de<z;de+=r){const pe=t[de],ue=t[de+1],he=squaredSegmentDistance(pe,ue,re,ie,ae,le);he>oe&&(V=de,oe=he)}oe>i&&(L[(V-e)/r]=1,j+r<V&&$.push(j,V),V+r<z&&$.push(V,z))}for(let z=0;z<k;++z)L[z]&&(g[y++]=t[e+z*r],g[y++]=t[e+z*r+1]);return y}function douglasPeuckerArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=douglasPeucker(t,e,V,r,i,g,y),k.push(y),e=V}return y}function snap(t,e){return e*Math.round(t/e)}function quantize(t,e,n,r,i,g,y){if(e==n)return y;let k=snap(t[e],i),L=snap(t[e+1],i);e+=r,g[y++]=k,g[y++]=L;let $,V;do if($=snap(t[e],i),V=snap(t[e+1],i),e+=r,e==n)return g[y++]=$,g[y++]=V,y;while($==k&&V==L);for(;e<n;){const z=snap(t[e],i),j=snap(t[e+1],i);if(e+=r,z==$&&j==V)continue;const oe=$-k,re=V-L,ie=z-k,ae=j-L;if(oe*ae==re*ie&&(oe<0&&ie<oe||oe==ie||oe>0&&ie>oe)&&(re<0&&ae<re||re==ae||re>0&&ae>re)){$=z,V=j;continue}g[y++]=$,g[y++]=V,k=$,L=V,$=z,V=j}return g[y++]=$,g[y++]=V,y}function quantizeArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=quantize(t,e,V,r,i,g,y),k.push(y),e=V}return y}function quantizeMultiArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L],z=[];y=quantizeArray(t,e,V,r,i,g,y,z),k.push(z),e=V[V.length-1]}return y}function inflateCoordinates(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=e;y<n;y+=r)i[g++]=t.slice(y,y+r);return i.length=g,i}function inflateCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=inflateCoordinates(t,e,L,r,i[g]),e=L}return i.length=g,i}function inflateMultiCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=L.length===1&&L[0]===e?[]:inflateCoordinatesArray(t,e,L,r,i[g]),e=L[L.length-1]}return i.length=g,i}function linearRing(t,e,n,r){let i=0;const g=t[n-r],y=t[n-r+1];let k=0,L=0;for(;e<n;e+=r){const $=t[e]-g,V=t[e+1]-y;i+=L*$-k*V,k=$,L=V}return i/2}function linearRings(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRing(t,e,k,r),e=k}return i}function linearRingss$1(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRings(t,e,k,r),e=k[k.length-1]}return i}class LinearRing extends SimpleGeometry{constructor(e,n){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}clone(){return new LinearRing(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,n,r,i))}getArea(){return linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LinearRing(n,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}function forEach(t,e,n,r,i){let g;for(e+=r;e<n;e+=r)if(g=i(t.slice(e-r,e),t.slice(e,e+r)),g)return g;return!1}function interpolatePoint(t,e,n,r,i,g,y){let k,L;const $=(n-e)/r;if($===1)k=e;else if($===2)k=e,L=i;else if($!==0){let V=t[e],z=t[e+1],j=0;const oe=[0];for(let ae=e+r;ae<n;ae+=r){const le=t[ae],de=t[ae+1];j+=Math.sqrt((le-V)*(le-V)+(de-z)*(de-z)),oe.push(j),V=le,z=de}const re=i*j,ie=binarySearch(oe,re);ie<0?(L=(re-oe[-ie-2])/(oe[-ie-1]-oe[-ie-2]),k=e+(-ie-2)*r):k=e+ie*r}y=y>1?y:2,g=g||new Array(y);for(let V=0;V<y;++V)g[V]=k===void 0?NaN:L===void 0?t[k+V]:lerp(t[k+V],t[k+r+V],L);return g}function lineStringCoordinateAtM(t,e,n,r,i,g){if(n==e)return null;let y;if(i<t[e+r-1])return g?(y=t.slice(e,e+r),y[r-1]=i,y):null;if(t[n-1]<i)return g?(y=t.slice(n-r,n),y[r-1]=i,y):null;if(i==t[e+r-1])return t.slice(e,e+r);let k=e/r,L=n/r;for(;k<L;){const j=k+L>>1;i<t[(j+1)*r-1]?L=j:k=j+1}const $=t[k*r-1];if(i==$)return t.slice((k-1)*r,(k-1)*r+r);const V=t[(k+1)*r-1],z=(i-$)/(V-$);y=[];for(let j=0;j<r-1;++j)y.push(lerp(t[(k-1)*r+j],t[k*r+j],z));return y.push(i),y}function lineStringsCoordinateAtM(t,e,n,r,i,g,y){if(y)return lineStringCoordinateAtM(t,e,n[n.length-1],r,i,g);let k;if(i<t[r-1])return g?(k=t.slice(0,r),k[r-1]=i,k):null;if(t[t.length-1]<i)return g?(k=t.slice(t.length-r),k[r-1]=i,k):null;for(let L=0,$=n.length;L<$;++L){const V=n[L];if(e!=V){if(i<t[e+r-1])return null;if(i<=t[V-1])return lineStringCoordinateAtM(t,e,V,r,i,!1);e=V}}return null}function linearRingContainsExtent(t,e,n,r,i){return!forEachCorner(i,function(y){return!linearRingContainsXY(t,e,n,r,y[0],y[1])})}function linearRingContainsXY(t,e,n,r,i,g){let y=0,k=t[n-r],L=t[n-r+1];for(;e<n;e+=r){const $=t[e],V=t[e+1];L<=g?V>g&&($-k)*(g-L)-(i-k)*(V-L)>0&&y++:V<=g&&($-k)*(g-L)-(i-k)*(V-L)<0&&y--,k=$,L=V}return y!==0}function linearRingsContainsXY(t,e,n,r,i,g){if(n.length===0||!linearRingContainsXY(t,e,n[0],r,i,g))return!1;for(let y=1,k=n.length;y<k;++y)if(linearRingContainsXY(t,n[y-1],n[y],r,i,g))return!1;return!0}function linearRingssContainsXY(t,e,n,r,i,g){if(n.length===0)return!1;for(let y=0,k=n.length;y<k;++y){const L=n[y];if(linearRingsContainsXY(t,e,L,r,i,g))return!0;e=L[L.length-1]}return!1}function intersectsLineString(t,e,n,r,i){const g=extendFlatCoordinates(createEmpty(),t,e,n,r);return intersects(i,g)?containsExtent(i,g)||g[0]>=i[0]&&g[2]<=i[2]||g[1]>=i[1]&&g[3]<=i[3]?!0:forEach(t,e,n,r,function(y,k){return intersectsSegment(i,y,k)}):!1}function intersectsLineStringArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){if(intersectsLineString(t,e,n[g],r,i))return!0;e=n[g]}return!1}function intersectsLinearRing(t,e,n,r,i){return!!(intersectsLineString(t,e,n,r,i)||linearRingContainsXY(t,e,n,r,i[0],i[1])||linearRingContainsXY(t,e,n,r,i[0],i[3])||linearRingContainsXY(t,e,n,r,i[2],i[1])||linearRingContainsXY(t,e,n,r,i[2],i[3]))}function intersectsLinearRingArray(t,e,n,r,i){if(!intersectsLinearRing(t,e,n[0],r,i))return!1;if(n.length===1)return!0;for(let g=1,y=n.length;g<y;++g)if(linearRingContainsExtent(t,n[g-1],n[g],r,i)&&!intersectsLineString(t,n[g-1],n[g],r,i))return!1;return!0}function intersectsLinearRingMultiArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(intersectsLinearRingArray(t,e,k,r,i))return!0;e=k[k.length-1]}return!1}function lineStringLength(t,e,n,r){let i=t[e],g=t[e+1],y=0;for(let k=e+r;k<n;k+=r){const L=t[k],$=t[k+1];y+=Math.sqrt((L-i)*(L-i)+($-g)*($-g)),i=L,g=$}return y}class LineString extends SimpleGeometry{constructor(e,n){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendCoordinate(e){extend$3(this.flatCoordinates,e),this.changed()}clone(){const e=new LineString(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,n,r,i))}forEachSegment(e){return forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,n){return this.layout!="XYM"&&this.layout!="XYZM"?null:(n=n!==void 0?n:!1,lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n))}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,n){return interpolatePoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,this.stride)}getLength(){return lineStringLength(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LineString(n,"XY")}getType(){return"LineString"}intersectsExtent(e){return intersectsLineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class MultiLineString extends SimpleGeometry{constructor(e,n,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,n);else if(n!==void 0&&r)this.setFlatCoordinates(n,e),this.ends_=r;else{const i=e,g=[],y=[];for(let L=0,$=i.length;L<$;++L){const V=i[L];extend$3(g,V.getFlatCoordinates()),y.push(g.length)}const k=i.length===0?this.getLayout():i[0].getLayout();this.setFlatCoordinates(k,g),this.ends_=y}}appendLineString(e){extend$3(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new MultiLineString(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,n,r,i))}getCoordinateAtM(e,n,r){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(n=n!==void 0?n:!1,r=r!==void 0?r:!1,lineStringsCoordinateAtM(this.flatCoordinates,0,this.ends_,this.stride,e,n,r))}getCoordinates(){return inflateCoordinatesArray(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new LineString(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,n=this.ends_,r=this.layout,i=[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y],$=new LineString(e.slice(g,L),r);i.push($),g=L}return i}getFlatMidpoints(){const e=[],n=this.flatCoordinates;let r=0;const i=this.ends_,g=this.stride;for(let y=0,k=i.length;y<k;++y){const L=i[y],$=interpolatePoint(n,r,L,g,.5);extend$3(e,$),r=L}return e}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=douglasPeuckerArray(this.flatCoordinates,0,this.ends_,this.stride,e,n,0,r),new MultiLineString(n,"XY",r)}getType(){return"MultiLineString"}intersectsExtent(e){return intersectsLineStringArray(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Point extends SimpleGeometry{constructor(e,n){super(),this.setCoordinates(e,n)}clone(){const e=new Point(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=squaredDistance$1(e,n,g[0],g[1]);if(y<i){const k=this.stride;for(let L=0;L<k;++L)r[L]=g[L];return r.length=k,y}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return createOrUpdateFromCoordinate(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return containsXY(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,n){this.setLayout(n,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinate(this.flatCoordinates,0,e,this.stride),this.changed()}}class MultiPoint extends SimpleGeometry{constructor(e,n){super(),n&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendPoint(e){extend$3(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new MultiPoint(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){if(i<closestSquaredDistanceXY(this.getExtent(),e,n))return i;const g=this.flatCoordinates,y=this.stride;for(let k=0,L=g.length;k<L;k+=y){const $=squaredDistance$1(e,n,g[k],g[k+1]);if($<i){i=$;for(let V=0;V<y;++V)r[V]=g[k+V];r.length=y}}return i}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const n=this.flatCoordinates.length/this.stride;return e<0||n<=e?null:new Point(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,n=this.layout,r=this.stride,i=[];for(let g=0,y=e.length;g<y;g+=r){const k=new Point(e.slice(g,g+r),n);i.push(k)}return i}getType(){return"MultiPoint"}intersectsExtent(e){const n=this.flatCoordinates,r=this.stride;for(let i=0,g=n.length;i<g;i+=r){const y=n[i],k=n[i+1];if(containsXY(e,y,k))return!0}return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}function getInteriorPointOfArray(t,e,n,r,i,g,y){let k,L,$,V,z,j,oe;const re=i[g+1],ie=[];for(let de=0,pe=n.length;de<pe;++de){const ue=n[de];for(V=t[ue-r],j=t[ue-r+1],k=e;k<ue;k+=r)z=t[k],oe=t[k+1],(re<=j&&oe<=re||j<=re&&re<=oe)&&($=(re-j)/(oe-j)*(z-V)+V,ie.push($)),V=z,j=oe}let ae=NaN,le=-1/0;for(ie.sort(ascending),V=ie[0],k=1,L=ie.length;k<L;++k){z=ie[k];const de=Math.abs(z-V);de>le&&($=(V+z)/2,linearRingsContainsXY(t,e,n,r,$,re)&&(ae=$,le=de)),V=z}return isNaN(ae)&&(ae=i[g]),y?(y.push(ae,re,le),y):[ae,re,le]}function getInteriorPointsOfMultiArray(t,e,n,r,i){let g=[];for(let y=0,k=n.length;y<k;++y){const L=n[y];g=getInteriorPointOfArray(t,e,L,r,i,2*y,g),e=L[L.length-1]}return g}function coordinates(t,e,n,r){for(;e<n-r;){for(let i=0;i<r;++i){const g=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=g}e+=r,n-=r}}function linearRingIsClockwise(t,e,n,r){let i=0,g=t[n-r],y=t[n-r+1];for(;e<n;e+=r){const k=t[e],L=t[e+1];i+=(k-g)*(L+y),g=k,y=L}return i===0?void 0:i>0}function linearRingsAreOriented(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);if(g===0){if(i&&L||!i&&!L)return!1}else if(i&&!L||!i&&L)return!1;e=k}return!0}function linearRingssAreOriented(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(!linearRingsAreOriented(t,e,k,r,i))return!1;k.length&&(e=k[k.length-1])}return!0}function orientLinearRings(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);(g===0?i&&L||!i&&!L:i&&!L||!i&&L)&&coordinates(t,e,k,r),e=k}return e}function orientLinearRingsArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g)e=orientLinearRings(t,e,n[g],r,i);return e}function inflateEnds(t,e){const n=[];let r=0,i=0,g;for(let y=0,k=e.length;y<k;++y){const L=e[y],$=linearRingIsClockwise(t,r,L,2);if(g===void 0&&(g=$),$===g)n.push(e.slice(i,y+1));else{if(n.length===0)continue;n[n.length-1].push(e[i])}i=y+1,r=L}return n}class Polygon extends SimpleGeometry{constructor(e,n,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,n!==void 0&&r?(this.setFlatCoordinates(n,e),this.ends_=r):this.setCoordinates(e,n)}appendLinearRing(e){this.flatCoordinates?extend$3(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Polygon(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,n)}getArea(){return linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRings(n,0,this.ends_,this.stride,e)):n=this.flatCoordinates,inflateCoordinatesArray(n,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=getCenter(this.getExtent());this.flatInteriorPoint_=getInteriorPointOfArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Point(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new LinearRing(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,n=this.flatCoordinates,r=this.ends_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y],$=new LinearRing(n.slice(g,L),e);i.push($),g=L}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingsAreOriented(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeArray(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),n,0,r),new Polygon(n,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return intersectsLinearRingArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}function fromExtent(t){if(isEmpty(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],r=t[2],i=t[3],g=[e,n,e,i,r,i,r,n,e,n];return new Polygon(g,"XY",[g.length])}function linearRingss(t,e,n,r){const i=[];let g=createEmpty();for(let y=0,k=n.length;y<k;++y){const L=n[y];g=createOrUpdateFromFlatCoordinates(t,e,L[0],r),i.push((g[0]+g[2])/2,(g[1]+g[3])/2),e=L[L.length-1]}return i}class MultiPolygon extends SimpleGeometry{constructor(e,n,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){const i=e,g=[],y=[];for(let k=0,L=i.length;k<L;++k){const $=i[k],V=g.length,z=$.getEnds();for(let j=0,oe=z.length;j<oe;++j)z[j]+=V;extend$3(g,$.getFlatCoordinates()),y.push(z)}n=i.length===0?this.getLayout():i[0].getLayout(),e=g,r=y}n!==void 0&&r?(this.setFlatCoordinates(n,e),this.endss_=r):this.setCoordinates(e,n)}appendPolygon(e){let n;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),n=e.getEnds().slice(),this.endss_.push();else{const r=this.flatCoordinates.length;extend$3(this.flatCoordinates,e.getFlatCoordinates()),n=e.getEnds().slice();for(let i=0,g=n.length;i<g;++i)n[i]+=r}this.endss_.push(n),this.changed()}clone(){const e=this.endss_.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=this.endss_[i].slice();const r=new MultiPolygon(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(multiArrayMaxSquaredDelta(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestMultiArrayPoint(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingssContainsXY(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,n)}getArea(){return linearRingss$1(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRingsArray(n,0,this.endss_,this.stride,e)):n=this.flatCoordinates,inflateMultiCoordinatesArray(n,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=linearRingss(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=getInteriorPointsOfMultiArray(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new MultiPoint(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingssAreOriented(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRingsArray(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeMultiArray(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),n,0,r),new MultiPolygon(n,"XY",r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let n;if(e===0)n=0;else{const g=this.endss_[e-1];n=g[g.length-1]}const r=this.endss_[e].slice(),i=r[r.length-1];if(n!==0)for(let g=0,y=r.length;g<y;++g)r[g]-=n;return new Polygon(this.flatCoordinates.slice(n,i),this.layout,r)}getPolygons(){const e=this.layout,n=this.flatCoordinates,r=this.endss_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y].slice(),$=L[L.length-1];if(g!==0)for(let z=0,j=L.length;z<j;++z)L[z]-=g;const V=new Polygon(n.slice(g,$),e,L);i.push(V),g=$}return i}getType(){return"MultiPolygon"}intersectsExtent(e){return intersectsLinearRingMultiArray(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateMultiCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{const i=r[r.length-1];this.flatCoordinates.length=i.length===0?0:i[i.length-1]}this.changed()}}const tmpTransform=create$2();class RenderFeature{constructor(e,n,r,i,g,y){this.styleFunction,this.extent_,this.id_=y,this.type_=e,this.flatCoordinates_=n,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r||null,this.properties_=g,this.squaredTolerance_,this.stride_=i,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?createOrUpdateFromCoordinate(this.flatCoordinates_):createOrUpdateFromFlatCoordinates(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=getCenter(this.getExtent());this.flatInteriorPoints_=getInteriorPointOfArray(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=inflateEnds(this.flatCoordinates_,this.ends_),n=linearRingss(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=getInteriorPointsOfMultiArray(this.flatCoordinates_,0,e,2,n)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=interpolatePoint(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let n=0;const r=this.ends_;for(let i=0,g=r.length;i<g;++i){const y=r[i],k=interpolatePoint(e,n,y,2,.5);extend$3(this.flatMidpoints_,k),n=y}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,n){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=get$1(e);const n=e.getExtent(),r=e.getWorldExtent();if(n&&r){const i=getHeight(r)/getHeight(n);compose(tmpTransform,r[0],r[3],i,-i,0,0,0),transform2D(this.flatCoordinates_,0,this.flatCoordinates_.length,2,tmpTransform,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new RenderFeature(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=memoizeOne((e,n)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);const r=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":r.length=douglasPeucker(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,r,0),i=[r.length];break;case"MultiLineString":i=[],r.length=douglasPeuckerArray(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,r,0,i);break;case"Polygon":i=[],r.length=quantizeArray(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),r,0,i);break}return i&&(this.simplifiedGeometry_=new RenderFeature(this.type_,r,i,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}RenderFeature.prototype.getFlatCoordinates=RenderFeature.prototype.getOrientedFlatCoordinates;class Source extends BaseObject{constructor(e){super(),this.projection=get$1(e.projection),this.attributions_=adaptAttributions(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const n=this;this.viewPromise_=new Promise(function(r,i){n.viewResolver=r,n.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=adaptAttributions(e),this.changed()}setState(e){this.state_=e,this.changed()}}function adaptAttributions(t){return t?typeof t=="function"?t:(Array.isArray(t)||(t=[t]),e=>t):null}const VectorEventType={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function all$1(t,e){return[[-1/0,-1/0,1/0,1/0]]}let withCredentials=!1;function loadFeaturesXhr(t,e,n,r,i,g,y){const k=new XMLHttpRequest;k.open("GET",typeof t=="function"?t(n,r,i):t,!0),e.getType()=="arraybuffer"&&(k.responseType="arraybuffer"),k.withCredentials=withCredentials,k.onload=function(L){if(!k.status||k.status>=200&&k.status<300){const $=e.getType();try{let V;$=="text"||$=="json"?V=k.responseText:$=="xml"?V=k.responseXML||k.responseText:$=="arraybuffer"&&(V=k.response),V?g(e.readFeatures(V,{extent:n,featureProjection:i}),e.readProjection(V)):y()}catch{y()}}else y()},k.onerror=y,k.send()}function xhr(t,e){return function(n,r,i,g,y){const k=this;loadFeaturesXhr(t,e,n,r,i,function(L,$){k.addFeatures(L),g!==void 0&&g(L)},y||VOID)}}class VectorSourceEvent extends BaseEvent{constructor(e,n,r){super(e),this.feature=n,this.features=r}}class VectorSource extends Source{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=VOID,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(assert(this.format_,"`format` must be set when `url` is set"),this.loader_=xhr(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:all$1;const n=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=n?new RBush:null,this.loadedExtentsRtree_=new RBush,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let r,i;Array.isArray(e.features)?i=e.features:e.features&&(r=e.features,i=r.getArray()),!n&&r===void 0&&(r=new Collection(i)),i!==void 0&&this.addFeaturesInternal(i),r!==void 0&&this.bindFeaturesCollection_(r)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const n=getUid(e);if(!this.addToIndex_(n,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(n,e);const r=e.getGeometry();if(r){const i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,e)}else this.nullGeometryFeatures_[n]=e;this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE,e))}setupChangeEvents_(e,n){n instanceof RenderFeature||(this.featureChangeKeys_[e]=[listen(n,EventType.CHANGE,this.handleFeatureChange_,this),listen(n,ObjectEventType.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,n){let r=!0;if(n.getId()!==void 0){const i=String(n.getId());if(!(i in this.idIndex_))this.idIndex_[i]=n;else if(n instanceof RenderFeature){const g=this.idIndex_[i];g instanceof RenderFeature?Array.isArray(g)?g.push(n):this.idIndex_[i]=[g,n]:r=!1}else r=!1}return r&&(assert(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=n),r}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const n=[],r=[],i=[];for(let g=0,y=e.length;g<y;g++){const k=e[g],L=getUid(k);this.addToIndex_(L,k)&&r.push(k)}for(let g=0,y=r.length;g<y;g++){const k=r[g],L=getUid(k);this.setupChangeEvents_(L,k);const $=k.getGeometry();if($){const V=$.getExtent();n.push(V),i.push(k)}else this.nullGeometryFeatures_[L]=k}if(this.featuresRtree_&&this.featuresRtree_.load(n,i),this.hasListener(VectorEventType.ADDFEATURE))for(let g=0,y=r.length;g<y;g++)this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE,r[g]))}bindFeaturesCollection_(e){let n=!1;this.addEventListener(VectorEventType.ADDFEATURE,function(r){n||(n=!0,e.push(r.feature),n=!1)}),this.addEventListener(VectorEventType.REMOVEFEATURE,function(r){n||(n=!0,e.remove(r.feature),n=!1)}),e.addEventListener(CollectionEventType.ADD,r=>{n||(n=!0,this.addFeature(r.element),n=!1)}),e.addEventListener(CollectionEventType.REMOVE,r=>{n||(n=!0,this.removeFeature(r.element),n=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const r in this.featureChangeKeys_)this.featureChangeKeys_[r].forEach(unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(r=>{this.removeFeatureInternal(r)});for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const n=new VectorSourceEvent(VectorEventType.CLEAR);this.dispatchEvent(n),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,n){const r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(i){const g=i.getGeometry();if(g instanceof RenderFeature||g.intersectsCoordinate(e))return n(i)})}forEachFeatureInExtent(e,n){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,n);this.featuresCollection_&&this.featuresCollection_.forEach(n)}forEachFeatureIntersectingExtent(e,n){return this.forEachFeatureInExtent(e,function(r){const i=r.getGeometry();if(i instanceof RenderFeature||i.intersectsExtent(e)){const g=n(r);if(g)return g}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),isEmpty$1(this.nullGeometryFeatures_)||extend$3(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const n=[];return this.forEachFeatureAtCoordinateDirect(e,function(r){n.push(r)}),n}getFeaturesInExtent(e,n){if(this.featuresRtree_){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const i=wrapAndSliceX(e,n);return[].concat(...i.map(g=>this.featuresRtree_.getInExtent(g)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,n){const r=e[0],i=e[1];let g=null;const y=[NaN,NaN];let k=1/0;const L=[-1/0,-1/0,1/0,1/0];return n=n||TRUE,this.featuresRtree_.forEachInExtent(L,function($){if(n($)){const V=$.getGeometry(),z=k;if(k=V instanceof RenderFeature?0:V.closestPointXY(r,i,y,k),k<z){g=$;const j=Math.sqrt(k);L[0]=r-j,L[1]=i-j,L[2]=r+j,L[3]=i+j}}}),g}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const n=this.idIndex_[e.toString()];return n!==void 0?n:null}getFeatureByUid(e){const n=this.uidIndex_[e];return n!==void 0?n:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const n=e.target,r=getUid(n),i=n.getGeometry();if(!i)r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(n),this.nullGeometryFeatures_[r]=n);else{const y=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(y,n)):this.featuresRtree_&&this.featuresRtree_.update(y,n)}const g=n.getId();if(g!==void 0){const y=g.toString();this.idIndex_[y]!==n&&(this.removeFromIdIndex_(n),this.idIndex_[y]=n)}else this.removeFromIdIndex_(n),this.uidIndex_[r]=n;this.changed(),this.dispatchEvent(new VectorSourceEvent(VectorEventType.CHANGEFEATURE,n))}hasFeature(e){const n=e.getId();return n!==void 0?n in this.idIndex_:getUid(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&isEmpty$1(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,n,r){const i=this.loadedExtentsRtree_,g=this.strategy_(e,n,r);for(let y=0,k=g.length;y<k;++y){const L=g[y];i.forEachInExtent(L,function(V){return containsExtent(V.extent,L)})||(++this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADSTART)),this.loader_.call(this,L,n,r,V=>{--this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADEND,void 0,V))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADERROR))}),i.insert(L,{extent:L.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const n=this.loadedExtentsRtree_,r=n.forEachInExtent(e,function(i){if(equals$1(i.extent,e))return i});r&&n.remove(r)}removeFeatures(e){let n=!1;for(let r=0,i=e.length;r<i;++r)n=this.removeFeatureInternal(e[r])||n;n&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const n=getUid(e);if(!(n in this.uidIndex_))return!1;n in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[n]:this.featuresRtree_&&this.featuresRtree_.remove(e);const r=this.featureChangeKeys_[n];r==null||r.forEach(unlistenByKey),delete this.featureChangeKeys_[n];const i=e.getId();if(i!==void 0){const g=i.toString(),y=this.idIndex_[g];y===e?delete this.idIndex_[g]:Array.isArray(y)&&(y.splice(y.indexOf(e),1),y.length===1&&(this.idIndex_[g]=y[0]))}return delete this.uidIndex_[n],this.hasListener(VectorEventType.REMOVEFEATURE)&&this.dispatchEvent(new VectorSourceEvent(VectorEventType.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const n in this.idIndex_)if(this.idIndex_[n]===e){delete this.idIndex_[n];break}}setLoader(e){this.loader_=e}setUrl(e){assert(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(xhr(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},rgb={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var xyz={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};xyz.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}},xyz.max=xyz.whitepoint[2].D65,xyz.rgb=function(t,e){e=e||xyz.whitepoint[2].E;var n=t[0]/e[0],r=t[1]/e[1],i=t[2]/e[2],g,y,k;return g=n*3.240969941904521+r*-1.537383177570093+i*-.498610760293,y=n*-.96924363628087+r*1.87596750150772+i*.041555057407175,k=n*.055630079696993+r*-.20397695888897+i*1.056971514242878,g=g>.0031308?1.055*Math.pow(g,1/2.4)-.055:g=g*12.92,y=y>.0031308?1.055*Math.pow(y,1/2.4)-.055:y=y*12.92,k=k>.0031308?1.055*Math.pow(k,1/2.4)-.055:k=k*12.92,g=Math.min(Math.max(0,g),1),y=Math.min(Math.max(0,y),1),k=Math.min(Math.max(0,k),1),[g*255,y*255,k*255]},rgb.xyz=function(t,e){var n=t[0]/255,r=t[1]/255,i=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var g=n*.41239079926595+r*.35758433938387+i*.18048078840183,y=n*.21263900587151+r*.71516867876775+i*.072192315360733,k=n*.019330818715591+r*.11919477979462+i*.95053215224966;return e=e||xyz.whitepoint[2].E,[g*e[0],y*e[1],k*e[2]]};const luv={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var r,i,g,y,k,L,$,V,z,j,oe,re,ie;if(g=t[0],y=t[1],k=t[2],g===0)return[0,0,0];var ae=.0011070564598794539;return e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],j=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],re=4*z/(z+15*j+3*oe),ie=9*j/(z+15*j+3*oe),r=y/(13*g)+re||0,i=k/(13*g)+ie||0,$=g>8?j*Math.pow((g+16)/116,3):j*g*ae,L=$*9*r/(4*i)||0,V=$*(12-3*r-20*i)/(4*i)||0,[L,$,V]}};xyz.luv=function(t,e,n){var r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae=.008856451679035631,le=903.2962962962961;e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],j=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],re=4*z/(z+15*j+3*oe),ie=9*j/(z+15*j+3*oe),L=t[0],$=t[1],V=t[2],r=4*L/(L+15*$+3*V)||0,i=9*$/(L+15*$+3*V)||0;var de=$/j;return g=de<=ae?le*de:116*Math.pow(de,1/3)-16,y=13*g*(r-re),k=13*g*(i-ie),[g,y,k]};var lchuv={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],r=t[2],i,g,y;return y=r/360*2*Math.PI,i=n*Math.cos(y),g=n*Math.sin(y),[e,i,g]},xyz:function(t){return luv.xyz(lchuv.luv(t))}};luv.lchuv=function(t){var e=t[0],n=t[1],r=t[2],i=Math.sqrt(n*n+r*r),g=Math.atan2(r,n),y=g*360/2/Math.PI;return y<0&&(y+=360),[e,i,y]},xyz.lchuv=function(t){return luv.lchuv(xyz.luv(t))};const names={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var baseHues={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function parse$1(t){var V,z;var e,n=[],r=1,i;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),names[t])n=names[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(t[0]==="#"){var g=t.slice(1),y=g.length,k=y<=4;r=1,k?(n=[parseInt(g[0]+g[0],16),parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16)],y===4&&(r=parseInt(g[3]+g[3],16)/255)):(n=[parseInt(g[0]+g[1],16),parseInt(g[2]+g[3],16),parseInt(g[4]+g[5],16)],y===8&&(r=parseInt(g[6]+g[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var L=e[1];i=L.replace(/a$/,"");var $=i==="cmyk"?4:i==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=n.shift()),n=n.map(function(j,oe){if(j[j.length-1]==="%")return j=parseFloat(j)/100,oe===3?j:i==="rgb"?j*255:i[0]==="h"||i[0]==="l"&&!oe?j*100:i==="lab"?j*125:i==="lch"?oe<2?j*150:j*360:i[0]==="o"&&!oe?j:i==="oklab"?j*.4:i==="oklch"?oe<2?j*.4:j*360:j;if(i[oe]==="h"||oe===2&&i[i.length-1]==="h"){if(baseHues[j]!==void 0)return baseHues[j];if(j.endsWith("deg"))return parseFloat(j);if(j.endsWith("turn"))return parseFloat(j)*360;if(j.endsWith("grad"))return parseFloat(j)*360/400;if(j.endsWith("rad"))return parseFloat(j)*180/Math.PI}return j==="none"?0:parseFloat(j)}),r=n.length>$?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(j){return parseFloat(j)}),i=((z=(V=t.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:z.toLowerCase())||"rgb");return{space:i,values:n,alpha:r}}const hsl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,g,y,k,L,$=0;if(n===0)return L=r*255,[L,L,L];for(g=r<.5?r*(1+n):r+n-r*n,i=2*r-g,k=[0,0,0];$<3;)y=e+1/3*-($-1),y<0?y++:y>1&&y--,L=6*y<1?i+(g-i)*6*y:2*y<1?g:3*y<2?i+(g-i)*(2/3-y)*6:i,k[$++]=L*255;return k}};rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),g=Math.max(e,n,r),y=g-i,k,L,$;return g===i?k=0:e===g?k=(n-r)/y:n===g?k=2+(r-e)/y:r===g&&(k=4+(e-n)/y),k=Math.min(k*60,360),k<0&&(k+=360),$=(i+g)/2,g===i?L=0:$<=.5?L=y/(g+i):L=y/(2-g-i),[k,L*100,$*100]};function rgba(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=parse$1(t);if(!n.space)return[];const r=n.space[0]==="h"?hsl.min:rgb.min,i=n.space[0]==="h"?hsl.max:rgb.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=hsl.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const NO_COLOR=[NaN,NaN,NaN,0];function asString(t){return typeof t=="string"?t:toString(t)}const MAX_CACHE_SIZE=1024,cache={};let cacheSize=0;function withAlpha(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function rgbaToLcha(t){const e=xyz.lchuv(rgb.xyz(t));return e[3]=t[3],e}function lchaToRgba(t){const e=xyz.rgb(lchuv.xyz(t));return e[3]=t[3],e}function fromString(t){if(t==="none")return NO_COLOR;if(cache.hasOwnProperty(t))return cache[t];if(cacheSize>=MAX_CACHE_SIZE){let n=0;for(const r in cache)n++&3||(delete cache[r],--cacheSize)}const e=rgba(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return normalize(e),cache[t]=e,++cacheSize,e}function asArray(t){return Array.isArray(t)?t:fromString(t)}function normalize(t){return t[0]=clamp(t[0]+.5|0,0,255),t[1]=clamp(t[1]+.5|0,0,255),t[2]=clamp(t[2]+.5|0,0,255),t[3]=clamp(t[3],0,1),t}function toString(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let r=t[2];r!=(r|0)&&(r=r+.5|0);const i=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+r+","+i+")"}const ua=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",FIREFOX=ua.includes("firefox"),SAFARI=ua.includes("safari")&&!ua.includes("chrom"),SAFARI_BUG_237906=SAFARI&&(ua.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ua)),WEBKIT=ua.includes("webkit")&&!ua.includes("edge"),MAC=ua.includes("macintosh"),DEVICE_PIXEL_RATIO=typeof devicePixelRatio<"u"?devicePixelRatio:1,WORKER_OFFSCREEN_CANVAS=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,IMAGE_DECODE=typeof Image<"u"&&Image.prototype.decode,PASSIVE_EVENT_LISTENERS=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function createCanvasContext2D(t,e,n,r){let i;return n&&n.length?i=n.shift():WORKER_OFFSCREEN_CANVAS?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}let sharedCanvasContext;function getSharedCanvasContext2D(){return sharedCanvasContext||(sharedCanvasContext=createCanvasContext2D(1,1)),sharedCanvasContext}function releaseCanvas$1(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function outerWidth(t){let e=t.offsetWidth;const n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),e}function outerHeight(t){let e=t.offsetHeight;const n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),e}function replaceNode(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function removeChildren(t){for(;t.lastChild;)t.lastChild.remove()}function replaceChildren(t,e){const n=t.childNodes;for(let r=0;;++r){const i=n[r],g=e[r];if(!i&&!g)break;if(i!==g){if(!i){t.appendChild(g);continue}if(!g){t.removeChild(i),--r;continue}t.insertBefore(g,i)}}}function listenImage(t,e,n){const r=t;let i=!0,g=!1,y=!1;const k=[listenOnce(r,EventType.LOAD,function(){y=!0,g||e()})];return r.src&&IMAGE_DECODE?(g=!0,r.decode().then(function(){i&&e()}).catch(function(L){i&&(y?e():n())})):k.push(listenOnce(r,EventType.ERROR,n)),function(){i=!1,k.forEach(unlistenByKey)}}function load(t,e){return new Promise((n,r)=>{function i(){y(),n(t)}function g(){y(),r(new Error("Image load error"))}function y(){t.removeEventListener("load",i),t.removeEventListener("error",g)}t.addEventListener("load",i),t.addEventListener("error",g)})}function decodeFallback(t,e){return e&&(t.src=e),t.src&&IMAGE_DECODE?new Promise((n,r)=>t.decode().then(()=>n(t)).catch(i=>t.complete&&t.width?n(t):r(i))):load(t)}class IconImageCache{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.cache_?this.cache_[i]:null}getPattern(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.patternCache_?this.patternCache_[i]:null}set(e,n,r,i,g){const y=getCacheKey$1(e,n,r),k=y in this.cache_;this.cache_[y]=i,g&&(i.getImageState()===ImageState.IDLE&&i.load(),i.getImageState()===ImageState.LOADING?i.ready().then(()=>{this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")}):this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")),k||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function getCacheKey$1(t,e,n){const r=n?asArray(n):"null";return e+":"+t+":"+r}const shared=new IconImageCache;let taintedTestContext=null;class IconImage extends Target{constructor(e,n,r,i,g){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=g,this.imageState_=i===void 0?ImageState.IDLE:i,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ImageState.LOADED){taintedTestContext||(taintedTestContext=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})),taintedTestContext.drawImage(this.image_,0,0);try{taintedTestContext.getImageData(0,0,1,1),this.tainted_=!1}catch{taintedTestContext=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(EventType.CHANGE)}handleImageError_(){this.imageState_=ImageState.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ImageState.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],r=createCanvasContext2D(e,n);r.fillRect(0,0,e,n),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ImageState.IDLE){this.image_||this.initializeImage_(),this.imageState_=ImageState.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&decodeFallback(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ImageState.LOADED)return;const n=this.image_,r=createCanvasContext2D(Math.ceil(n.width*e),Math.ceil(n.height*e)),i=r.canvas;r.scale(e,e),r.drawImage(n,0,0),r.globalCompositeOperation="multiply",r.fillStyle=asString(this.color_),r.fillRect(0,0,i.width/e,i.height/e),r.globalCompositeOperation="destination-in",r.drawImage(n,0,0),this.canvas_[e]=i}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)e();else{const n=()=>{(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)&&(this.removeEventListener(EventType.CHANGE,n),e())};this.addEventListener(EventType.CHANGE,n)}})),this.ready_}}function get(t,e,n,r,i,g){let y=e===void 0?void 0:shared.get(e,n,i);return y||(y=new IconImage(t,t&&"src"in t?t.src||void 0:e,n,r,i),shared.set(e,n,i,y,g)),g&&y&&!shared.getPattern(e,n,i)&&shared.set(e,n,i,y,g),y}function hasArea(t){return t[0]>0&&t[1]>0}function scale$1(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function toSize(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class ImageStyle{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=toSize(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ImageStyle({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return abstract()}getImage(e){return abstract()}getHitDetectionImage(){return abstract()}getPixelRatio(e){return 1}getImageState(){return abstract()}getImageSize(){return abstract()}getOrigin(){return abstract()}getSize(){return abstract()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=toSize(e)}listenImageChange(e){abstract()}load(){abstract()}unlistenImageChange(e){abstract()}ready(){return Promise.resolve()}}function asColorLike(t){return t?Array.isArray(t)?toString(t):typeof t=="object"&&"src"in t?asCanvasPattern(t):t:null}function asCanvasPattern(t){if(!t.offset||!t.size)return shared.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=shared.getPattern(e,void 0,t.color);if(n)return n;const r=shared.get(t.src,"anonymous",null);if(r.getImageState()!==ImageState.LOADED)return null;const i=createCanvasContext2D(t.size[0],t.size[1]);return i.drawImage(r.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),get(i.canvas,e,void 0,ImageState.LOADED,t.color,!0),shared.getPattern(e,void 0,t.color)}const CLASS_HIDDEN="ol-hidden",CLASS_SELECTABLE="ol-selectable",CLASS_UNSELECTABLE="ol-unselectable",CLASS_CONTROL="ol-control",CLASS_COLLAPSED="ol-collapsed",fontRegEx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),fontRegExMatchIndex=["style","variant","weight","size","lineHeight","family"],getFontParameters=function(t){const e=t.match(fontRegEx);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let r=0,i=fontRegExMatchIndex.length;r<i;++r){const g=e[r+1];g!==void 0&&(n[fontRegExMatchIndex[r]]=g)}return n.families=n.family.split(/,\s?/),n},defaultFont="10px sans-serif",defaultFillStyle="#000",defaultLineCap="round",defaultLineDash=[],defaultLineDashOffset=0,defaultLineJoin="round",defaultMiterLimit=10,defaultStrokeStyle="#000",defaultTextAlign="center",defaultTextBaseline="middle",defaultPadding=[0,0,0,0],defaultLineWidth=1,checkedFonts=new BaseObject;let measureContext=null,measureFont;const textHeights={},registerFont=function(){const e="32px ",n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";let g,y;function k($,V,z){let j=!0;for(let oe=0;oe<r;++oe){const re=n[oe];if(y=measureTextWidth($+" "+V+" "+e+re,i),z!=re){const ie=measureTextWidth($+" "+V+" "+e+z+","+re,i);j=j&&ie!=y}}return!!j}function L(){let $=!0;const V=checkedFonts.getKeys();for(let z=0,j=V.length;z<j;++z){const oe=V[z];if(checkedFonts.get(oe)<100){const[re,ie,ae]=oe.split(`
53
+ hooks.version="2.30.1",setHookCallback(createLocal),hooks.fn=proto,hooks.min=min,hooks.max=max,hooks.now=now,hooks.utc=createUTC,hooks.unix=createUnix,hooks.months=listMonths,hooks.isDate=isDate,hooks.locale=getSetGlobalLocale,hooks.invalid=createInvalid,hooks.duration=createDuration,hooks.isMoment=isMoment,hooks.weekdays=listWeekdays,hooks.parseZone=createInZone,hooks.localeData=getLocale,hooks.isDuration=isDuration,hooks.monthsShort=listMonthsShort,hooks.weekdaysMin=listWeekdaysMin,hooks.defineLocale=defineLocale,hooks.updateLocale=updateLocale,hooks.locales=listLocales,hooks.weekdaysShort=listWeekdaysShort,hooks.normalizeUnits=normalizeUnits,hooks.relativeTimeRounding=getSetRelativeTimeRounding,hooks.relativeTimeThreshold=getSetRelativeTimeThreshold,hooks.calendarFormat=getCalendarFormat,hooks.prototype=proto,hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const DEFAULT_VALUE$1="--",LOG_DATE_FORMAT_T="YYYY-MM-DDTHH:mm:ss",LOG_DATE_FORMAT_END="YYYY-MM-DDT23:59:59",DATE_PICKER_FORMAT="YYYY-MM-DD",CDN_URL$1="https://static.zhihaoscm.cn/",dateFormat=(t,e=DATE_PICKER_FORMAT)=>t?hooks(t).format(e).replace("Invalid date",DEFAULT_VALUE$1):DEFAULT_VALUE$1,validateNumber=t=>typeof t=="number"?!0:typeof t=="string"?!isNaN(parseFloat(t)):!1;function digitUppercase(t){const e=["角","分"],n=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],r=[["元","万","亿"],["","拾","佰","仟"]],i=t<0?"负":"";t=Math.abs(t);let g="";for(let y=0;y<e.length;y++)g+=(n[Math.floor(t*10*Math.pow(10,y))%10]+e[y]).replace(/零./,"");g=g||"整",t=Math.floor(t);for(let y=0;y<r[0].length&&t>0;y++){let k="";for(let L=0;L<r[1].length&&t>0;L++)k=n[t%10]+r[1][L]+k,t=Math.floor(t/10);g=k.replace(/(零.)*零$/,"").replace(/^$/,"零")+r[0][y]+g}return i+g.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整")}function hexToRgb(t){let e=t.replace(/^#/,"");e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return[n,r,i]}function calculateBrightness(t){const[e,n,r]=t;return .299*e+.587*n+.114*r}function getForegroundColor(t,e=128){t==="white"&&(t="#fff"),t==="black"&&(t="#000");const n=hexToRgb(t);return calculateBrightness(n)>e?"black":"white"}const _sfc_main$u=vue.defineComponent({name:"zh-date-picker",__name:"DatePicker",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,r=e,i=k=>Array.isArray(k)?[dateFormat(k[0],LOG_DATE_FORMAT_T),dateFormat(k[1],LOG_DATE_FORMAT_END)]:k&&dateFormat(k,LOG_DATE_FORMAT_T),g=k=>{const L=i(k);r("update:modelValue",L)},y=k=>{const L=i(k);r("change",L)};return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([n.class,"zh-date-picker"])},[vue.createVNode(vue.unref(ElDatePicker),vue.mergeProps(k.$attrs,{style:n.style,"model-value":n.modelValue,"onUpdate:modelValue":g,onChange:y}),null,16,["style","model-value"])],2))}}),ZhDatePicker=withInstall$1(_sfc_main$u),_hoisted_1$k={class:"info-pair"},_hoisted_2$e={class:"info-pair--title"},_hoisted_3$e={key:0,class:"info-pair--title--tip"},_sfc_main$t=vue.defineComponent({name:"zh-detail-sub-title",__name:"DetailSubTitle",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$k,[vue.createElementVNode("div",_hoisted_2$e,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$e,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)])],2)]))}}),ZhDetailSubTitle=withInstall$1(_sfc_main$t),_hoisted_1$j={class:"title"},_hoisted_2$d={key:0,class:"sub-title"},_hoisted_3$d={class:"zh-dialog__footer"},_sfc_main$s=vue.defineComponent({name:"ZhDialog",inheritAttrs:!1,__name:"Dialog",props:vue.mergeModels({title:{},subTitle:{},cancelButtonText:{default:"取消"},confirmButtonText:{default:"确定"},confirmButtonDisabled:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1},size:{default:"middle"},width:{},appendToBody:{type:Boolean},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean},closeOnPressEscape:{type:Boolean},lockScroll:{type:Boolean},modal:{type:Boolean},openDelay:{},closeDelay:{},top:{},modelValue:{type:Boolean},modalClass:{},zIndex:{},trapFocus:{type:Boolean},headerAriaLevel:{},center:{type:Boolean},alignCenter:{type:Boolean},closeIcon:{},draggable:{type:Boolean},overflow:{type:Boolean},fullscreen:{type:Boolean},showClose:{type:Boolean},ariaLevel:{}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:vue.mergeModels(["submit","close"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=e,g=()=>{i("close")},y=()=>{i("submit")},k=()=>{i("close")},L={small:"400px",middle:"600px",large:"800px",extraLarge:"920px"},$=vue.computed(()=>n.width?n.width:L[n.size]);return(V,z)=>(vue.openBlock(),vue.createBlock(vue.unref(ElDialog),vue.mergeProps({modelValue:r.value,"onUpdate:modelValue":z[0]||(z[0]=j=>r.value=j),class:"zh-dialog"},V.$attrs,{width:$.value,"close-on-click-modal":V.closeOnClickModal,onClose:k}),{header:vue.withCtx(()=>[vue.renderSlot(V.$slots,"header",{},()=>[vue.createElementVNode("div",_hoisted_1$j,vue.toDisplayString(V.title),1),V.subTitle?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$d,vue.toDisplayString(V.subTitle),1)):vue.createCommentVNode("",!0)])]),footer:vue.withCtx(()=>[vue.renderSlot(V.$slots,"footer",{},()=>[vue.createElementVNode("div",_hoisted_3$d,[vue.createVNode(ZhButton$1,{plain:"",onClick:g},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.cancelButtonText),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",disabled:V.confirmButtonDisabled,onClick:y},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(V.confirmButtonText),1)]),_:1},8,["disabled"])])])]),default:vue.withCtx(()=>[vue.renderSlot(V.$slots,"default")]),_:3},16,["modelValue","width","close-on-click-modal"]))}}),ZhDialog=withInstall$1(_sfc_main$s),_hoisted_1$i={class:"info-pair"},_hoisted_2$c={class:"info-pair--title"},_hoisted_3$c={key:0,class:"info-pair--title--tip"},_sfc_main$r=vue.defineComponent({name:"zh-edit-info-pair",__name:"EditInfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$i,[vue.createElementVNode("div",_hoisted_2$c,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$c,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),EditInfoPair=_export_sfc(_sfc_main$r,[["__scopeId","data-v-c62707eb"]]),ZhEditInfoPair=withInstall$1(EditInfoPair),_hoisted_1$h={class:"file_wrapper"},_hoisted_2$b={key:0,class:"header"},_hoisted_3$b={class:"file_main"},_hoisted_4$6={class:"file"},_hoisted_5$6={class:"file_name"},_sfc_main$q=vue.defineComponent({name:"zh-file-wrapper",__name:"FileWrapper",props:{downLoadUrl:{type:String,default:""},canPreview:{type:Boolean,default:!1},fileName:{type:String,default:DEFAULT_VALUE$1},canDelete:{type:Boolean,default:!1},title:{type:String,default:""},fileId:{type:Number,default:0}},emits:["deleteFile"],setup(t,{emit:e}){const n=t,r=e,i=()=>{n.canDelete&&r("deleteFile",n.fileId)};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$h,[n.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$b,vue.toDisplayString(n.title),1)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_3$b,[vue.createElementVNode("div",_hoisted_4$6,[y[0]||(y[0]=vue.createElementVNode("div",{class:"file_type mr-12"},[vue.createElementVNode("i",{class:"iconfont icon-xiangmuguanli"})],-1)),vue.createElementVNode("div",_hoisted_5$6,vue.toDisplayString(n.fileName),1)]),vue.createVNode(vue.unref(ElLink),{size:"small",class:"btn",link:"",style:{width:"80px"},href:n.downLoadUrl,underline:!1,download:"download"},{default:vue.withCtx(()=>y[1]||(y[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href"]),t.canDelete?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close close",onClick:i})):vue.createCommentVNode("",!0)])]))}}),FileWrapper=_export_sfc(_sfc_main$q,[["__scopeId","data-v-d98ece31"]]),ZhFileWrapper=withInstall$1(FileWrapper),_sfc_main$p=vue.defineComponent({name:"Grid",__name:"Grid",props:{cols:{default:()=>({xs:1,sm:2,md:2,lg:4,xl:4})},collapsed:{type:Boolean,default:!1},collapsedRows:{default:1},gap:{default:16},enableSameLabelWidthInCol:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=t;vue.onBeforeMount(()=>n.collapsed&&L()),vue.onMounted(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onActivated(()=>{r({target:{innerWidth:window.innerWidth}}),window.addEventListener("resize",r)}),vue.onUnmounted(()=>{window.removeEventListener("resize",r)}),vue.onDeactivated(()=>{window.removeEventListener("resize",r)});const r=j=>{let oe=j.target.innerWidth;switch(!!oe){case oe<768:i.value="xs";break;case(oe>=768&&oe<992):i.value="sm";break;case(oe>=992&&oe<1200):i.value="md";break;case(oe>=1200&&oe<1920):i.value="lg";break;case oe>=1920:i.value="xl";break}};vue.provide("gap",Array.isArray(n.gap)?n.gap[0]:n.gap);let i=vue.ref("xl");vue.provide("breakPoint",i);const g=vue.ref(-1);vue.provide("shouldHiddenIndex",g);const y=vue.computed(()=>typeof n.cols=="object"?n.cols[i.value]??n.cols:n.cols);vue.provide("cols",y);const k=vue.useSlots().default(),L=()=>{var ie,ae,le,de;let j=[],oe=null;k.forEach(pe=>{var ue;typeof pe.type=="object"&&pe.type.name==="GridItem"&&((ue=pe.props)==null?void 0:ue.suffix)!==void 0&&(oe=pe),typeof pe.type=="symbol"&&Array.isArray(pe.children)&&j.push(...pe.children)});let re=0;oe&&(re=(((ie=oe.props[i.value])==null?void 0:ie.span)??((ae=oe.props)==null?void 0:ae.span)??1)+(((le=oe.props[i.value])==null?void 0:le.offset)??((de=oe.props)==null?void 0:de.offset)??0));try{let pe=!1;j.reduce((ue=0,he,Ce)=>{var _e,xe,Ie,Oe;if(ue+=(((_e=he.props[i.value])==null?void 0:_e.span)??((xe=he.props)==null?void 0:xe.span)??1)+(((Ie=he.props[i.value])==null?void 0:Ie.offset)??((Oe=he.props)==null?void 0:Oe.offset)??0),Number(ue)>n.collapsedRows*y.value-re)throw g.value=Ce,pe=!0,"find it";return ue},0),pe||(g.value=-1)}catch{}};vue.watch(()=>i.value,()=>{n.collapsed&&L()}),vue.watch(()=>n.collapsed,j=>{if(j)return L();g.value=-1});const $=vue.computed(()=>typeof n.gap=="number"?`${n.gap}px`:Array.isArray(n.gap)?`${n.gap[1]}px ${n.gap[0]}px`:"unset"),V=vue.computed(()=>({display:"grid",gridGap:$.value,gridTemplateColumns:`repeat(${y.value}, minmax(0, 1fr))`})),z=vue.ref(!1);return vue.onMounted(()=>{z.value=!0}),vue.onBeforeUpdate(()=>{z.value=!1}),vue.onUpdated(()=>{z.value=!0}),vue.provide("isRegistrationComplete",z),e({breakPoint:i}),(j,oe)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(V.value)},[vue.renderSlot(j.$slots,"default")],4))}}),_sfc_main$o=vue.defineComponent({name:"GridItem",__name:"GridItem",props:{offset:{default:0},span:{default:1},suffix:{type:Boolean,default:!1},xs:{default:void 0},sm:{default:void 0},md:{default:void 0},lg:{default:void 0},xl:{default:void 0},label:{}},setup(t){const e=t,n=vue.useAttrs(),r=vue.ref(!0),i=vue.inject("breakPoint",vue.ref("xl")),g=vue.inject("shouldHiddenIndex",vue.ref(-1));vue.watch(()=>[g.value,i.value],le=>{n.index&&(r.value=!(le[0]!==-1&&parseInt(n.index)>=Number(le[0])))},{immediate:!0});const y=vue.inject("gap",0),k=vue.inject("cols",vue.ref(4)),L=vue.computed(()=>{var pe,ue;let le=((pe=e[i.value])==null?void 0:pe.span)??e.span,de=((ue=e[i.value])==null?void 0:ue.offset)??e.offset;return e.suffix?{gridColumnStart:k.value-le-de+1,gridColumnEnd:`span ${le+de}`,marginLeft:de!==0?`calc(((100% + ${y}px) / ${le+de}) * ${de})`:"unset"}:{gridColumn:`span ${le+de>k.value?k.value:le+de}/span ${le+de>k.value?k.value:le+de}`,marginLeft:de!==0?`calc(((100% + ${y}px) / ${le+de}) * ${de})`:"unset"}}),$=vue.inject("isMultiGrid",vue.ref(!1)),V=vue.ref(null),z=vue.ref(0),j=vue.ref(0),oe=vue.inject("registerGridItem",null),re=vue.inject("getColumnData",null),ie=vue.inject("isRegistrationComplete",vue.ref(!1)),ae=()=>{if(V.value&&oe){const le=V.value.parentElement;if(le){const de=V.value.offsetLeft,pe=le.offsetWidth/k.value;j.value=Math.floor(de/pe)+1,oe(j.value,e.label||"")}}};return vue.watchEffect(()=>{if($.value&&ie.value&&e.label&&V.value&&(ae(),re)){const le=re(j.value);z.value=le.maxWidth||0}}),(le,de)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(L.value),ref_key:"gridItemRef",ref:V},[vue.renderSlot(le.$slots,"default",{maxLabelWidthInCol:z.value,columnIndex:j.value})],4)),[[vue.vShow,r.value]])}}),DEFAULT_FONT_SIZE=12;function findItemNested(t,e,n,r){return t.reduce((i,g)=>{if(i)return i;if(g[n]===e)return g;if(g[r])return findItemNested(g[r],e,n,r)},null)}function getValueByProp(t,e,n){const r=isUndefined$2(n)?DEFAULT_VALUE$1:n,i=get$5(t,e);return isNil(i)||i===""?r:i}const $get=getValueByProp;function handleProp(t){const e=t.split(".");return e.length==1?t:e[e.length-1]}function filterEnum(t,e,n,r){const i=(n==null?void 0:n.value)??"value",g=(n==null?void 0:n.label)??"label",y=(n==null?void 0:n.children)??"children";let k={};return Array.isArray(e)&&(k=findItemNested(e,t,i,y)),r=="tag"?k!=null&&k.tagType?k.tagType:"":k?k[g]:DEFAULT_VALUE$1}function filterEnumObj(t,e,n){const r="value",i="children";let g={};return Array.isArray(e)&&(g=findItemNested(e,t,r,i)),g}function formatValue(t){return isArray$2(t)?t.length?t.join(" / "):DEFAULT_VALUE$1:t??DEFAULT_VALUE$1}function handleRowAccordingToProp(t,e){return e.includes(".")?(e.split(".").forEach(n=>t=t[n]??DEFAULT_VALUE$1),t):t[e]??DEFAULT_VALUE$1}const getWidthByText=(t,e)=>{const n=e||DEFAULT_FONT_SIZE,i=document.createElement("canvas").getContext("2d");return i.font=`${n}px Microsoft YaHei`,i.measureText(t).width},useColSetting=t=>{const e=t||"zhihao-col-setting",n=()=>{const k=localStorage.getItem(e);return k?JSON.parse(k):{}},r=k=>{localStorage.setItem(e,JSON.stringify(k))};return{getMap:n,setMap:r,getColumnCache:k=>n()[k]||[],setColumnCache:(k,L)=>{const $=n();$[k]=L,r($)},removeColumnCache:k=>{const L=n();delete L[k],r(L)}}},collectGridItems=()=>{const t=vue.reactive({});return{gridItemData:t,registerGridItem:(r,i)=>{var y;if(!i)return;t[r]||(t[r]={labels:[],maxLength:0,maxWidth:0}),(y=t[r])==null||y.labels.push(i),t[r].maxLength=Math.max(i.length,t[r].maxLength);const g=Math.ceil(getWidthByText(i,14));t[r].maxWidth=Math.max(g||0,t[r].maxWidth)},getColumnData:r=>t[r]||{}}},_hoisted_1$g={class:"multi-grid"},_sfc_main$n=vue.defineComponent({name:"MultiGrid",__name:"MultiGrid",setup(t){const{getColumnData:e,registerGridItem:n}=collectGridItems();return vue.provide("registerGridItem",n),vue.provide("getColumnData",e),vue.provide("isMultiGrid",vue.ref(!0)),(r,i)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$g,[vue.renderSlot(r.$slots,"default")]))}}),ZhGrid=withInstall$1(_sfc_main$p),ZhGridItem=withInstall$1(_sfc_main$o),ZhMultiGrid=withInstall$1(_sfc_main$n),_hoisted_1$f={class:"info-pair"},_hoisted_2$a={class:"info-pair--title"},_hoisted_3$a={key:0,class:"info-pair--title--tip"},_sfc_main$m=vue.defineComponent({name:"zh-info-pair",__name:"InfoPair",props:{title:{},value:{},ellipsis:{type:Boolean},tip:{}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$f,[vue.createElementVNode("div",_hoisted_2$a,[vue.createTextVNode(vue.toDisplayString(e.title)+" ",1),n.tip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$a,vue.toDisplayString(n.tip),1)):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",{class:vue.normalizeClass(["info-pair--value",{ellipsis:n.ellipsis}])},[vue.renderSlot(n.$slots,"value",{},()=>[vue.createTextVNode(vue.toDisplayString(e.value||vue.unref(DEFAULT_VALUE$1)),1)],!0)],2)]))}}),InfoPair=_export_sfc(_sfc_main$m,[["__scopeId","data-v-5a1b0655"]]),ZhInfoPair=withInstall$1(InfoPair),_sfc_main$l=vue.defineComponent({name:"zh-input",__name:"Input",props:vue.mergeModels({style:{},class:{default:"zh-default-input"},size:{default:"default"},className:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=vue.useAttrs(),n=t,r=vue.useModel(t,"modelValue"),i=()=>{(e.max||Number(e.max)===0)&&Number(r.value)>=e.max&&(r.value=e.max.toString()),(e.min||Number(e.min)===0)&&Number(r.value)<=e.min&&(r.value=e.min.toString())};return(g,y)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(n.class)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps(g.$attrs,{modelValue:r.value,"onUpdate:modelValue":y[0]||(y[0]=k=>r.value=k),size:g.size,onBlur:i}),vue.createSlots({_:2},[vue.renderList(g.$slots,(k,L)=>({name:k,fn:vue.withCtx($=>[vue.renderSlot(g.$slots,k,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","size"])],2))}}),Input=_export_sfc(_sfc_main$l,[["__scopeId","data-v-ce1df798"]]),ZhInput=withInstall$1(Input),_sfc_main$k=vue.defineComponent({name:"zh-input-number",__name:"InputNumber",props:{style:{},class:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=vue.useAttrs(),g=($,V=0,z=0,j=0)=>{let oe=($==null?void 0:$.toString())??"",re,ie,ae;return z===0?(oe=oe.replace(/[^\d]/g,""),oe=oe.replace(/^0\d+/g,"0"),V!==0&&(oe=oe.slice(0,V))):(oe=oe.replace(/[^\-\d.]/g,""),oe=oe.replace(/^[^\-\d]/g,""),oe=oe.replace(/\.{2}/g,"."),oe=oe.replace(/^0(\d+)/g,"$1"),re=oe.split(".")||[],re.length>1?(V===0?ie=re[0]:ie=re[0].slice(0,V),ae=re[1].slice(0,z),oe=ie+"."+ae):V!==0&&(oe=oe.slice(0,V))),j!==0&&(oe=oe.slice(0,j)),oe},y=()=>{n.modelValue===""||n.modelValue===void 0||(i.max&&Number(n.modelValue)>i.max&&r("update:modelValue",i.max.toString()),i.min&&Number(n.modelValue)<i.min&&r("update:modelValue",i.min.toString()))},k=$=>$?g($,i.integer,i.precision,i.maxLength):"",L=$=>{/^\d+\.0*$/.test(($==null?void 0:$.toString())||"")||$===""?r("update:modelValue",k($)):r("update:modelValue",Number(k($)))};return($,V)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(["input-number",n.class]),style:vue.normalizeStyle(n.style)},[vue.createVNode(vue.unref(ElInput),vue.mergeProps($.$attrs,{"model-value":n.modelValue,"onUpdate:modelValue":L,onBlur:y,style:{width:"100%"},formatter:k}),vue.createSlots({_:2},[vue.renderList(Object.keys($.$slots),z=>({name:z,fn:vue.withCtx(j=>[vue.renderSlot($.$slots,z,vue.normalizeProps(vue.guardReactiveProps(j)),void 0,!0)])}))]),1040,["model-value"])],6))}}),InputNumber=_export_sfc(_sfc_main$k,[["__scopeId","data-v-920e8405"]]),ZhInputNumber=withInstall$1(InputNumber),_hoisted_1$e={class:"loading-box"},_sfc_main$j=vue.defineComponent({name:"zh-loading",__name:"Loading",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$e,n[0]||(n[0]=[vue.createElementVNode("div",{class:"loading-wrap"},[vue.createElementVNode("span",{class:"dot dot-spin"},[vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i"),vue.createElementVNode("i")])],-1)])))}}),Loading=_export_sfc(_sfc_main$j,[["__scopeId","data-v-d30f17c3"]]),ZhLoading=withInstall$1(Loading),defaultOptions={type:"",showCancelButton:!0,showConfirmButton:!0,cancelButtonText:"取消",confirmButtonText:"确定",closeOnClickModal:!1,closeOnPressEscape:!1,showClose:!0,draggable:!1,center:!1,roundButton:!1},ZhMessageBox$1={confirm(t,e,n={}){return ElMessageBox.confirm(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-confirm"})},alert(t,e,n={}){return ElMessageBox.alert(t,e,{...defaultOptions,...n,showCancelButton:!1,customClass:"zh-message-box zh-message-alert"})},prompt(t,e,n={}){return ElMessageBox.prompt(t,e,{...defaultOptions,...n,customClass:"zh-message-box zh-message-prompt"})}},ZhConfirm=ZhMessageBox$1.confirm,ZhAlert=ZhMessageBox$1.alert,ZhPrompt=ZhMessageBox$1.prompt,ZhMessageBox=withInstall$1(ZhMessageBox$1),_sfc_main$i=vue.defineComponent({name:"zh-money-input",__name:"MoneyInput",props:vue.mergeModels({style:{},class:{},showTooltip:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:vue.mergeModels(["update:modelValue"],["update:modelValue"]),setup(t,{emit:e}){const n=t,r=vue.useModel(t,"modelValue"),i=vue.computed(()=>{if(r.value)return validateNumber(r.value)&&Number(r.value)>=1e3?digitUppercase(Number(r.value)):""}),g=vue.ref(!1);return(y,k)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{effect:"dark",content:i.value,placement:"top",visible:y.showTooltip&&g.value&&!!i.value},{default:vue.withCtx(()=>[vue.createVNode(InputNumber,vue.mergeProps(y.$attrs,{modelValue:r.value,"onUpdate:modelValue":k[0]||(k[0]=L=>r.value=L),style:n.style,class:n.class,onFocus:k[1]||(k[1]=()=>g.value=!0),onBlur:k[2]||(k[2]=()=>g.value=!1)}),vue.createSlots({_:2},[vue.renderList(Object.keys(y.$slots),L=>({name:L,fn:vue.withCtx($=>[vue.renderSlot(y.$slots,L,vue.normalizeProps(vue.guardReactiveProps($)),void 0,!0)])}))]),1040,["modelValue","style","class"])]),_:3},8,["content","visible"]))}}),MoneyInput=_export_sfc(_sfc_main$i,[["__scopeId","data-v-632c1920"]]),ZhMoneyInput=withInstall$1(MoneyInput),_hoisted_1$d={class:"page-head"},_hoisted_2$9={class:"left-wrap"},_hoisted_3$9={class:"page-name"},_hoisted_4$5={class:"value"},_hoisted_5$5={class:"other-inform"},_hoisted_6$5={class:"label"},_hoisted_7$5={class:"value mg-r-24"},_hoisted_8$3={class:"status"},_sfc_main$h=vue.defineComponent({name:"zh-page-head-panel",__name:"PageHeadPanel",props:{dataSource:{}},setup(t){const e=t,{name:n,no:r,status:i,extendLabel:g,extendValue:y}=vue.toRefs(e.dataSource);return(k,L)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$9,[vue.createElementVNode("span",_hoisted_3$9,vue.toDisplayString(vue.unref(n)),1),vue.createElementVNode("div",null,[L[0]||(L[0]=vue.createElementVNode("span",{class:"label mg-l-16"},"编号",-1)),vue.createElementVNode("span",_hoisted_4$5,vue.toDisplayString(vue.unref(r)),1)])]),vue.createElementVNode("div",_hoisted_5$5,[vue.renderSlot(k.$slots,"extend",{},()=>[vue.createElementVNode("span",_hoisted_6$5,vue.toDisplayString(vue.unref(g)),1),vue.createElementVNode("span",_hoisted_7$5,vue.toDisplayString(vue.unref(y)),1)],!0),vue.createElementVNode("span",_hoisted_8$3,vue.toDisplayString(vue.unref(i)),1)])]))}}),PageHeadPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-9f56969d"]]),ZhPageHeadPanel=withInstall$1(PageHeadPanel),_sfc_main$g=vue.defineComponent({name:"zh-tool-tips",__name:"ToolTips",props:{placement:{type:String,default:"top"},content:{type:String,default:"top"}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:e.content,placement:e.placement},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},()=>[r[0]||(r[0]=vue.createElementVNode("i",{class:"iconfont icon-Frame2"},null,-1))],!0)]),_:3},8,["content","placement"]))}}),ToolTips=_export_sfc(_sfc_main$g,[["__scopeId","data-v-c0ccb80e"]]),ZhToolTips=withInstall$1(ToolTips),_sfc_main$f=vue.defineComponent({name:"ZhBaseInfo",__name:"BaseInfo",props:{contentWidth:{default:void 0},labelWidth:{default:"70px"},infoDirection:{default:"vertical"},cols:{default:5},gap:{default:16}},setup(t){const e=t,n=vue.ref(),r=vue.ref(),i=vue.ref();vue.provide("infoLabelWidth",n),vue.provide("infoContentWidth",r),vue.provide("infoDirection",i);function g(){n.value=e.labelWidth}function y(){r.value=e.contentWidth}function k(){i.value=e.infoDirection}return vue.watch(()=>e.contentWidth,()=>y(),{immediate:!0}),vue.watch(()=>e.labelWidth,()=>g(),{immediate:!0}),vue.watch(()=>e.infoDirection,()=>k(),{immediate:!0}),(L,$)=>{const V=vue.resolveComponent("grid");return vue.openBlock(),vue.createBlock(V,{cols:L.cols,gap:L.gap},{default:vue.withCtx(()=>[vue.renderSlot(L.$slots,"default")]),_:3},8,["cols","gap"])}}}),ZhBaseInfo=withInstall$1(_sfc_main$f),_hoisted_1$c={class:"common-card"},_hoisted_2$8={class:"detail-header"},_hoisted_3$8={class:"detail-header--left"},_hoisted_4$4={class:"title common-title"},_hoisted_5$4={class:"info-pair--label"},_hoisted_6$4={class:"info-pair--value"},_hoisted_7$4={key:1,class:"detail-header--right"},_hoisted_8$2={class:"info-pair--label"},_hoisted_9$1={class:"info-pair--value"},_sfc_main$e=vue.defineComponent({name:"ZhDetailHeader",__name:"DetailHeader",props:{title:{},leftInfos:{},rightInfos:{},stateMeta:{},stateDesc:{}},setup(t){const e=vue.useSlots(),n=t;return(r,i)=>{var g,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$c,[vue.createElementVNode("div",null,[vue.renderSlot(r.$slots,"menu",{},void 0,!0)]),vue.createElementVNode("div",_hoisted_2$8,[vue.createElementVNode("div",_hoisted_3$8,[vue.createElementVNode("div",_hoisted_4$4,vue.toDisplayString(n.title),1),vue.renderSlot(r.$slots,"extra-info",{},void 0,!0),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.leftInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_5$4,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_6$4,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128))]),vue.renderSlot(r.$slots,"default",{},void 0,!0),vue.unref(e)["right-infos"]?vue.renderSlot(r.$slots,"right-infos",{key:0},void 0,!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_7$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.rightInfos,k=>(vue.openBlock(),vue.createElementBlock("div",{class:"info-pair",key:k.value},[vue.createElementVNode("div",_hoisted_8$2,vue.toDisplayString(k.label),1),vue.createElementVNode("div",_hoisted_9$1,vue.toDisplayString(k.value??vue.unref(DEFAULT_VALUE$1)),1)]))),128)),r.stateDesc||r.stateMeta?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["state common-title",(g=r.stateMeta)==null?void 0:g.state])},vue.toDisplayString(r.stateDesc||((y=r.stateMeta)==null?void 0:y.intro)),3)):vue.createCommentVNode("",!0)]))])])}}}),DetailHeader=_export_sfc(_sfc_main$e,[["__scopeId","data-v-8b185816"]]),ZhDetailHeader=withInstall$1(DetailHeader);var DIY_DATA_TYPE=(t=>(t.AUTOCOMPLETE="autocomplete",t.FORMAT="format",t.TEXT="text",t))(DIY_DATA_TYPE||{});const _hoisted_1$b={key:0},_hoisted_2$7={key:1,class:"col-edit-header"},_hoisted_3$7=["onClick"],_hoisted_4$3={key:0},_hoisted_5$3={class:"header-operation-container"},_hoisted_6$3={class:"operation-container"},_hoisted_7$3=["onClick"],ZH_DIV="$ZH_DIV$",_sfc_main$d=vue.defineComponent({name:"zh-diy-data-table",__name:"DiyDataTable",props:vue.mergeModels({isEdit:{type:Boolean,default:!1},maxRowLength:{default:50},maxColLength:{default:10},defaultMinWidth:{default:120},beforeAddRow:{}},{rawData:{required:!0},rawDataModifiers:{}}),emits:["update:rawData"],setup(t,{expose:e}){const n=t,r=vue.useModel(t,"rawData"),i=vue.ref([]),g=()=>{if(r.value.length===n.maxRowLength){ElMessage({message:`最多添加${n.maxRowLength}行`,type:"warning"});return}let re={};n.beforeAddRow&&(re=n.beforeAddRow(r.value)),r.value.push(re)},y=()=>{if(i.value.filter(ae=>ae.isAdd).length>=n.maxColLength){ElMessage({message:`最多添加${n.maxColLength}列`,type:"warning"});return}const ie=String(Date.now());i.value.push({prop:ie,label:"",isEditHeader:!0,isAdd:!0,maxlength:15,minWidth:150,headerMaxlength:15})},k=(re,ie)=>{i.value.splice(re,1),r.value.forEach(ae=>{delete ae[ie.prop]})},L=re=>{re===0&&i.value.forEach(ie=>{ie.isSameData&&(r.value[1][ie.prop]=r.value[0][ie.prop])}),r.value.splice(re,1)},$=(re,ie,ae)=>{ie(ae.completeList.filter(le=>le.includes(re)).map(le=>({value:le})))},V=re=>[{validator:(ie,ae,le)=>{if(!i.value[re].label){le(new Error("请输入表头"));return}le()},message:"请输入表头",trigger:["blur","change"]}],z=re=>{const ie=[];return re.required&&ie.push({required:!0,message:"请输入"+re.label,trigger:re.slot?void 0:"blur"}),re.varidate&&ie.push({validator:(ae,le,de)=>{const pe=re.varidate(le);pe!==!0?de(new Error(pe)):de()},trigger:re.slot?void 0:"blur"}),ie},j=(re,ie)=>{let ae=re;return ie.isSameData&&(ae=r.value[0]||DEFAULT_VALUE$1),ie.formatter?ie.showFormatter?ie.type===DIY_DATA_TYPE.FORMAT?ie.showFormatter(ie.formatter(ae)):ie.showFormatter(ae[ie.prop]):ie.formatter(ae[ie.prop]):ae[ie.prop]||DEFAULT_VALUE$1},oe=vue.ref();return e({initData:(re,ie)=>{console.log("initData",re,ie),re=cloneDeep(re)||[],re.length===0&&re.push({}),ie=[...ie];for(const ae in re[0])if(!ie.some(le=>le.prop===ae)){const le=Date.now()+ae,de=ae.split(ZH_DIV);if(de.length!==2){console.log("keySplit 失败",ae);continue}const pe=Number(de[1]);ie[pe]={prop:ae,isEditHeader:!0,label:de[0],key:le,isAdd:!0,maxlength:15,headerMaxlength:15}}r.value=re,i.value=ie},getData:async()=>{await oe.value.validate();for(const ie in i.value){const ae=i.value[ie];for(const le of i.value)if(ae.prop!==le.prop&&ae.label===le.label){ElMessage({message:"所有列的表头不可重复",type:"warning"});return}}const re=cloneDeep(r.value);for(const ie in re){const ae=re[ie];for(const le in i.value){const de=i.value[le];if(de.isSameData&&ie!=="0"&&(ae[de.prop]=re[0][de.prop]),de.varidate&&!de.varidate(ae[de.prop]))return;if(de.isAdd){const pe=ae[de.prop];delete ae[de.prop];const ue=de.label+ZH_DIV+le;ae[ue]=pe}de.formatter&&de.type===DIY_DATA_TYPE.FORMAT&&(ae[de.prop]=de.formatter(ae))}}return console.log("DiyDataTable 获取数据",re,i.value),{data:re,columns:i.value}},updateColumn:(re,ie)=>{const ae=i.value[re].prop;if(i.value[re]=ie,ae!==ie.prop)for(const le of r.value)le[ie.prop]=le[ae],delete le[ae]},resetColumns:re=>{const ae=i.value.filter(de=>!de.isAdd).reduce((de,pe)=>(re.some(ue=>ue.prop===pe.prop)||de.push(pe.prop),de),[]);r.value.forEach(de=>{ae.forEach(pe=>{delete de[pe]})});const le=re.filter(de=>de.isAdd);i.value=[...re,...le]}}),(re,ie)=>(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{class:"diy-data-table",model:t.rawData,ref_key:"formRef",ref:oe},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTable),{data:r.value},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{type:"index",label:"序号",width:"132",fixed:"left"}),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.value,(ae,le)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:ae.key||le,prop:ae.prop,label:ae.label,width:ae.width,"min-width":ae.minWidth||re.defaultMinWidth,fixed:ae.fixed},{header:vue.withCtx(()=>[re.isEdit?ae.isEditHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$7,[vue.createVNode(vue.unref(ElFormItem),{prop:`columns.${le}`,rules:V(le)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:ae.label,"onUpdate:modelValue":de=>ae.label=de,maxlength:ae.headerMaxlength||20,placeholder:"请输入表头"},null,8,["modelValue","onUpdate:modelValue","maxlength"])]),_:2},1032,["prop","rules"]),ae.isAdd?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:de=>k(le,ae)},null,8,_hoisted_3$7)):vue.createCommentVNode("",!0)])):(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass({"is-required-label":ae.required})},vue.toDisplayString(ae.label),3)):(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$b,vue.toDisplayString(ae.label),1))]),default:vue.withCtx(de=>[n.isEdit&&(!ae.isSameData||de.$index===0)&&ae.type!==vue.unref(DIY_DATA_TYPE).TEXT?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,prop:`${de.$index}.${ae.prop}`,rules:z(ae),class:vue.normalizeClass(["col-edit-container",{"close-padding":ae.isAdd}])},{default:vue.withCtx(()=>[ae.type===vue.unref(DIY_DATA_TYPE).FORMAT&&ae.formatter?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4$3,vue.toDisplayString(ae.showFormatter?ae.showFormatter(ae.formatter(de.row)):ae.formatter(de.row)),1)):ae.type===vue.unref(DIY_DATA_TYPE).AUTOCOMPLETE?(vue.openBlock(),vue.createBlock(vue.unref(ElAutocomplete),{key:1,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入","fetch-suggestions":(pe,ue)=>$(pe,ue,ae),maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","fetch-suggestions","maxlength"])):ae.slot?vue.renderSlot(re.$slots,ae.slot,{key:2,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:3,modelValue:de.row[ae.prop],"onUpdate:modelValue":pe=>de.row[ae.prop]=pe,placeholder:ae.placeholder||"请输入",formatter:ae.formatter,parser:ae.parser,maxlength:ae.maxlength||20},null,8,["modelValue","onUpdate:modelValue","placeholder","formatter","parser","maxlength"]))]),_:2},1032,["prop","rules","class"])):ae.slot?vue.renderSlot(re.$slots,ae.slot,{key:1,row:de.row,$index:de.$index},void 0,!0):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[vue.createTextVNode(vue.toDisplayString(j(de.row,ae)),1)],64))]),_:2},1032,["prop","label","width","min-width","fixed"]))),128)),n.isEdit?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),{key:0,width:"150",fixed:"right"},{header:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$3,[vue.createVNode(vue.unref(ElButton),{type:"primary",link:"",onClick:g},{default:vue.withCtx(()=>ie[0]||(ie[0]=[vue.createElementVNode("i",{class:"iconfont icon-Frame1"},null,-1),vue.createTextVNode("增行")])),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",link:"",onClick:y},{default:vue.withCtx(()=>ie[1]||(ie[1]=[vue.createElementVNode("i",{class:"iconfont icon-Frame-11"},null,-1),vue.createTextVNode("增列")])),_:1})])]),default:vue.withCtx(({$index:ae})=>[vue.createElementVNode("div",_hoisted_6$3,[r.value.length>1?(vue.openBlock(),vue.createElementBlock("i",{key:0,class:"iconfont icon-close",onClick:le=>L(ae)},null,8,_hoisted_7$3)):vue.createCommentVNode("",!0)])]),_:1})):vue.createCommentVNode("",!0)]),_:3},8,["data"])]),_:3},8,["model"]))}}),DiyDataTable=_export_sfc(_sfc_main$d,[["__scopeId","data-v-52d02832"]]),ZhDiyDataTable=withInstall$1(DiyDataTable);var BaseMapType=(t=>(t[t.vector=0]="vector",t[t.satellite=1]="satellite",t))(BaseMapType||{});class BaseEvent{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const ObjectEventType={PROPERTYCHANGE:"propertychange"};class Disposable{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function binarySearch(t,e,n){let r,i;n=n||ascending;let g=0,y=t.length,k=!1;for(;g<y;)r=g+(y-g>>1),i=+n(t[r],e),i<0?g=r+1:(y=r,k=!i);return k?g:~g}function ascending(t,e){return t>e?1:t<e?-1:0}function descending(t,e){return t<e?1:t>e?-1:0}function linearFindNearest(t,e,n){if(t[0]<=e)return 0;const r=t.length;if(e<=t[r-1])return r-1;if(typeof n=="function"){for(let i=1;i<r;++i){const g=t[i];if(g===e)return i;if(g<e)return n(e,t[i-1],g)>0?i-1:i}return r-1}if(n>0){for(let i=1;i<r;++i)if(t[i]<e)return i-1;return r-1}if(n<0){for(let i=1;i<r;++i)if(t[i]<=e)return i;return r-1}for(let i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return r-1}function reverseSubArray(t,e,n){for(;e<n;){const r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function extend$3(t,e){const n=Array.isArray(e)?e:[e],r=n.length;for(let i=0;i<r;i++)t[t.length]=n[i]}function equals$2(t,e){const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function isSorted(t,e,n){const r=e||ascending;return t.every(function(i,g){if(g===0)return!0;const y=r(t[g-1],i);return!(y>0||y===0)})}function TRUE(){return!0}function FALSE(){return!1}function VOID(){}function memoizeOne(t){let e,n,r;return function(){const i=Array.prototype.slice.call(arguments);return(!n||this!==r||!equals$2(i,n))&&(r=this,n=i,e=t.apply(this,arguments)),e}}function toPromise(t){function e(){let n;try{n=t()}catch(r){return Promise.reject(r)}return n instanceof Promise?n:Promise.resolve(n)}return e()}function clear(t){for(const e in t)delete t[e]}function isEmpty$1(t){let e;for(e in t)return!1;return!e}class Target extends Disposable{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,n){if(!e||!n)return;const r=this.listeners_||(this.listeners_={}),i=r[e]||(r[e]=[]);i.includes(n)||i.push(n)}dispatchEvent(e){const n=typeof e=="string",r=n?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;const g=n?new BaseEvent(e):e;g.target||(g.target=this.eventTarget_||this);const y=this.dispatching_||(this.dispatching_={}),k=this.pendingRemovals_||(this.pendingRemovals_={});r in y||(y[r]=0,k[r]=0),++y[r];let L;for(let $=0,V=i.length;$<V;++$)if("handleEvent"in i[$]?L=i[$].handleEvent(g):L=i[$].call(this,g),L===!1||g.propagationStopped){L=!1;break}if(--y[r]===0){let $=k[r];for(delete k[r];$--;)this.removeEventListener(r,VOID);delete y[r]}return L}disposeInternal(){this.listeners_&&clear(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,n){if(!this.listeners_)return;const r=this.listeners_[e];if(!r)return;const i=r.indexOf(n);i!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[i]=VOID,++this.pendingRemovals_[e]):(r.splice(i,1),r.length===0&&delete this.listeners_[e]))}}const EventType={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function listen(t,e,n,r,i){if(i){const y=n;n=function(){t.removeEventListener(e,n),y.apply(r??this,arguments)}}else r&&r!==t&&(n=n.bind(r));const g={target:t,type:e,listener:n};return t.addEventListener(e,n),g}function listenOnce(t,e,n,r){return listen(t,e,n,r,!0)}function unlistenByKey(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),clear(t))}class Observable extends Target{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(EventType.CHANGE)}getRevision(){return this.revision_}onInternal(e,n){if(Array.isArray(e)){const r=e.length,i=new Array(r);for(let g=0;g<r;++g)i[g]=listen(this,e[g],n);return i}return listen(this,e,n)}onceInternal(e,n){let r;if(Array.isArray(e)){const i=e.length;r=new Array(i);for(let g=0;g<i;++g)r[g]=listenOnce(this,e[g],n)}else r=listenOnce(this,e,n);return n.ol_key=r,r}unInternal(e,n){const r=n.ol_key;if(r)unByKey(r);else if(Array.isArray(e))for(let i=0,g=e.length;i<g;++i)this.removeEventListener(e[i],n);else this.removeEventListener(e,n)}}Observable.prototype.on,Observable.prototype.once,Observable.prototype.un;function unByKey(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)unlistenByKey(t[e]);else unlistenByKey(t)}function abstract(){throw new Error("Unimplemented abstract method.")}let uidCounter_=0;function getUid(t){return t.ol_uid||(t.ol_uid=String(++uidCounter_))}class ObjectEvent extends BaseEvent{constructor(e,n,r){super(e),this.key=n,this.oldValue=r}}class BaseObject extends Observable{constructor(e){super(),this.on,this.once,this.un,getUid(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let n;return this.values_&&this.values_.hasOwnProperty(e)&&(n=this.values_[e]),n}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,n){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n)),r=ObjectEventType.PROPERTYCHANGE,this.hasListener(r)&&this.dispatchEvent(new ObjectEvent(r,e,n))}addChangeListener(e,n){this.addEventListener(`change:${e}`,n)}removeChangeListener(e,n){this.removeEventListener(`change:${e}`,n)}set(e,n,r){const i=this.values_||(this.values_={});if(r)i[e]=n;else{const g=i[e];i[e]=n,g!==n&&this.notify(e,g)}}setProperties(e,n){for(const r in e)this.set(r,e[r],n)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,n){if(this.values_&&e in this.values_){const r=this.values_[e];delete this.values_[e],isEmpty$1(this.values_)&&(this.values_=null),n||this.notify(e,r)}}}const CollectionEventType={ADD:"add",REMOVE:"remove"},Property$3={LENGTH:"length"};class CollectionEvent extends BaseEvent{constructor(e,n,r){super(e),this.element=n,this.index=r}}class Collection extends BaseObject{constructor(e,n){if(super(),this.on,this.once,this.un,n=n||{},this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(let r=0,i=this.array_.length;r<i;++r)this.assertUnique_(this.array_[r],r);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let n=0,r=e.length;n<r;++n)this.push(e[n]);return this}forEach(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)e(n[r],r,n)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Property$3.LENGTH)}insertAt(e,n){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n),this.array_.splice(e,0,n),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);const n=this.getLength();return this.insertAt(n,e),this.getLength()}remove(e){const n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e)return this.removeAt(r)}removeAt(e){if(e<0||e>=this.getLength())return;const n=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,n,e)),n}setAt(e,n){const r=this.getLength();if(e>=r){this.insertAt(e,n);return}if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(n,e);const i=this.array_[e];this.array_[e]=n,this.dispatchEvent(new CollectionEvent(CollectionEventType.REMOVE,i,e)),this.dispatchEvent(new CollectionEvent(CollectionEventType.ADD,n,e))}updateLength_(){this.set(Property$3.LENGTH,this.array_.length)}assertUnique_(e,n){for(let r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===e&&r!==n)throw new Error("Duplicate item added to a unique collection")}}function quickselect(t,e,n=0,r=t.length-1,i=defaultCompare){for(;r>n;){if(r-n>600){const L=r-n+1,$=e-n+1,V=Math.log(L),z=.5*Math.exp(2*V/3),j=.5*Math.sqrt(V*z*(L-z)/L)*($-L/2<0?-1:1),oe=Math.max(n,Math.floor(e-$*z/L+j)),re=Math.min(r,Math.floor(e+(L-$)*z/L+j));quickselect(t,e,oe,re,i)}const g=t[e];let y=n,k=r;for(swap(t,n,e),i(t[r],g)>0&&swap(t,n,r);y<k;){for(swap(t,y,k),y++,k--;i(t[y],g)<0;)y++;for(;i(t[k],g)>0;)k--}i(t[n],g)===0?swap(t,n,k):(k++,swap(t,k,r)),k<=e&&(n=k+1),e<=k&&(r=k-1)}}function swap(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function defaultCompare(t,e){return t<e?-1:t>e?1:0}let RBush$1=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let n=this.data;const r=[];if(!intersects$1(e,n))return r;const i=this.toBBox,g=[];for(;n;){for(let y=0;y<n.children.length;y++){const k=n.children[y],L=n.leaf?i(k):k;intersects$1(e,L)&&(n.leaf?r.push(k):contains(e,L)?this._all(k,r):g.push(k))}n=g.pop()}return r}collides(e){let n=this.data;if(!intersects$1(e,n))return!1;const r=[];for(;n;){for(let i=0;i<n.children.length;i++){const g=n.children[i],y=n.leaf?this.toBBox(g):g;if(intersects$1(e,y)){if(n.leaf||contains(e,y))return!0;r.push(g)}}n=r.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let r=0;r<e.length;r++)this.insert(e[r]);return this}let n=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){const r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=createNode([]),this}remove(e,n){if(!e)return this;let r=this.data;const i=this.toBBox(e),g=[],y=[];let k,L,$;for(;r||g.length;){if(r||(r=g.pop(),L=g[g.length-1],k=y.pop(),$=!0),r.leaf){const V=findItem(e,r.children,n);if(V!==-1)return r.children.splice(V,1),g.push(r),this._condense(g),this}!$&&!r.leaf&&contains(r,i)?(g.push(r),y.push(k),k=0,L=r,r=r.children[0]):L?(k++,r=L.children[k],$=!1):r=null}return this}toBBox(e){return e}compareMinX(e,n){return e.minX-n.minX}compareMinY(e,n){return e.minY-n.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,n){const r=[];for(;e;)e.leaf?n.push(...e.children):r.push(...e.children),e=r.pop();return n}_build(e,n,r,i){const g=r-n+1;let y=this._maxEntries,k;if(g<=y)return k=createNode(e.slice(n,r+1)),calcBBox(k,this.toBBox),k;i||(i=Math.ceil(Math.log(g)/Math.log(y)),y=Math.ceil(g/Math.pow(y,i-1))),k=createNode([]),k.leaf=!1,k.height=i;const L=Math.ceil(g/y),$=L*Math.ceil(Math.sqrt(y));multiSelect(e,n,r,$,this.compareMinX);for(let V=n;V<=r;V+=$){const z=Math.min(V+$-1,r);multiSelect(e,V,z,L,this.compareMinY);for(let j=V;j<=z;j+=L){const oe=Math.min(j+L-1,z);k.children.push(this._build(e,j,oe,i-1))}}return calcBBox(k,this.toBBox),k}_chooseSubtree(e,n,r,i){for(;i.push(n),!(n.leaf||i.length-1===r);){let g=1/0,y=1/0,k;for(let L=0;L<n.children.length;L++){const $=n.children[L],V=bboxArea($),z=enlargedArea(e,$)-V;z<y?(y=z,g=V<g?V:g,k=$):z===y&&V<g&&(g=V,k=$)}n=k||n.children[0]}return n}_insert(e,n,r){const i=r?e:this.toBBox(e),g=[],y=this._chooseSubtree(i,this.data,n,g);for(y.children.push(e),extend$2(y,i);n>=0&&g[n].children.length>this._maxEntries;)this._split(g,n),n--;this._adjustParentBBoxes(i,g,n)}_split(e,n){const r=e[n],i=r.children.length,g=this._minEntries;this._chooseSplitAxis(r,g,i);const y=this._chooseSplitIndex(r,g,i),k=createNode(r.children.splice(y,r.children.length-y));k.height=r.height,k.leaf=r.leaf,calcBBox(r,this.toBBox),calcBBox(k,this.toBBox),n?e[n-1].children.push(k):this._splitRoot(r,k)}_splitRoot(e,n){this.data=createNode([e,n]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)}_chooseSplitIndex(e,n,r){let i,g=1/0,y=1/0;for(let k=n;k<=r-n;k++){const L=distBBox(e,0,k,this.toBBox),$=distBBox(e,k,r,this.toBBox),V=intersectionArea(L,$),z=bboxArea(L)+bboxArea($);V<g?(g=V,i=k,y=z<y?z:y):V===g&&z<y&&(y=z,i=k)}return i||r-n}_chooseSplitAxis(e,n,r){const i=e.leaf?this.compareMinX:compareNodeMinX,g=e.leaf?this.compareMinY:compareNodeMinY,y=this._allDistMargin(e,n,r,i),k=this._allDistMargin(e,n,r,g);y<k&&e.children.sort(i)}_allDistMargin(e,n,r,i){e.children.sort(i);const g=this.toBBox,y=distBBox(e,0,n,g),k=distBBox(e,r-n,r,g);let L=bboxMargin(y)+bboxMargin(k);for(let $=n;$<r-n;$++){const V=e.children[$];extend$2(y,e.leaf?g(V):V),L+=bboxMargin(y)}for(let $=r-n-1;$>=n;$--){const V=e.children[$];extend$2(k,e.leaf?g(V):V),L+=bboxMargin(k)}return L}_adjustParentBBoxes(e,n,r){for(let i=r;i>=0;i--)extend$2(n[i],e)}_condense(e){for(let n=e.length-1,r;n>=0;n--)e[n].children.length===0?n>0?(r=e[n-1].children,r.splice(r.indexOf(e[n]),1)):this.clear():calcBBox(e[n],this.toBBox)}};function findItem(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function calcBBox(t,e){distBBox(t,0,t.children.length,e,t)}function distBBox(t,e,n,r,i){i||(i=createNode(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let g=e;g<n;g++){const y=t.children[g];extend$2(i,t.leaf?r(y):y)}return i}function extend$2(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function compareNodeMinX(t,e){return t.minX-e.minX}function compareNodeMinY(t,e){return t.minY-e.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function intersectionArea(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),g=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,g-r)}function contains(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function intersects$1(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,e,n,r,i){const g=[e,n];for(;g.length;){if(n=g.pop(),e=g.pop(),n-e<=r)continue;const y=e+Math.ceil((n-e)/r/2)*r;quickselect(t,y,e,n,i),g.push(e,y,y,n)}}const Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function boundingExtent(t){const e=createEmpty();for(let n=0,r=t.length;n<r;++n)extendCoordinate(e,t[n]);return e}function _boundingExtentXYs(t,e,n){const r=Math.min.apply(null,t),i=Math.min.apply(null,e),g=Math.max.apply(null,t),y=Math.max.apply(null,e);return createOrUpdate$2(r,i,g,y,n)}function buffer(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function clone$1(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function closestSquaredDistanceXY(t,e,n){let r,i;return e<t[0]?r=t[0]-e:t[2]<e?r=e-t[2]:r=0,n<t[1]?i=t[1]-n:t[3]<n?i=n-t[3]:i=0,r*r+i*i}function containsCoordinate(t,e){return containsXY(t,e[0],e[1])}function containsExtent(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function containsXY(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function coordinateRelationship(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=e[0],k=e[1];let L=Relationship.UNKNOWN;return y<n?L=L|Relationship.LEFT:y>i&&(L=L|Relationship.RIGHT),k<r?L=L|Relationship.BELOW:k>g&&(L=L|Relationship.ABOVE),L===Relationship.UNKNOWN&&(L=Relationship.INTERSECTING),L}function createEmpty(){return[1/0,1/0,-1/0,-1/0]}function createOrUpdate$2(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function createOrUpdateEmpty(t){return createOrUpdate$2(1/0,1/0,-1/0,-1/0,t)}function createOrUpdateFromCoordinate(t,e){const n=t[0],r=t[1];return createOrUpdate$2(n,r,n,r,e)}function createOrUpdateFromFlatCoordinates(t,e,n,r,i){const g=createOrUpdateEmpty(i);return extendFlatCoordinates(g,t,e,n,r)}function equals$1(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function extend$1(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function extendCoordinate(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function extendFlatCoordinates(t,e,n,r,i){for(;n<r;n+=i)extendXY(t,e[n],e[n+1]);return t}function extendXY(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function forEachCorner(t,e){let n;return n=e(getBottomLeft(t)),n||(n=e(getBottomRight(t)),n)||(n=e(getTopRight(t)),n)||(n=e(getTopLeft(t)),n)?n:!1}function getArea$1(t){let e=0;return isEmpty(t)||(e=getWidth(t)*getHeight(t)),e}function getBottomLeft(t){return[t[0],t[1]]}function getBottomRight(t){return[t[2],t[1]]}function getCenter(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function getCorner(t,e){let n;if(e==="bottom-left")n=getBottomLeft(t);else if(e==="bottom-right")n=getBottomRight(t);else if(e==="top-left")n=getTopLeft(t);else if(e==="top-right")n=getTopRight(t);else throw new Error("Invalid corner");return n}function getForViewAndSize(t,e,n,r,i){const[g,y,k,L,$,V,z,j]=getRotatedViewport(t,e,n,r);return createOrUpdate$2(Math.min(g,k,$,z),Math.min(y,L,V,j),Math.max(g,k,$,z),Math.max(y,L,V,j),i)}function getRotatedViewport(t,e,n,r){const i=e*r[0]/2,g=e*r[1]/2,y=Math.cos(n),k=Math.sin(n),L=i*y,$=i*k,V=g*y,z=g*k,j=t[0],oe=t[1];return[j-L+z,oe-$-V,j-L-z,oe-$+V,j+L-z,oe+$+V,j+L+z,oe+$-V,j-L+z,oe-$-V]}function getHeight(t){return t[3]-t[1]}function getIntersection(t,e,n){const r=createEmpty();return intersects(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):createOrUpdateEmpty(r),r}function getTopLeft(t){return[t[0],t[3]]}function getTopRight(t){return[t[2],t[3]]}function getWidth(t){return t[2]-t[0]}function intersects(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function isEmpty(t){return t[2]<t[0]||t[3]<t[1]}function returnOrUpdate(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function intersectsSegment(t,e,n){let r=!1;const i=coordinateRelationship(t,e),g=coordinateRelationship(t,n);if(i===Relationship.INTERSECTING||g===Relationship.INTERSECTING)r=!0;else{const y=t[0],k=t[1],L=t[2],$=t[3],V=e[0],z=e[1],j=n[0],oe=n[1],re=(oe-z)/(j-V);let ie,ae;g&Relationship.ABOVE&&!(i&Relationship.ABOVE)&&(ie=j-(oe-$)/re,r=ie>=y&&ie<=L),!r&&g&Relationship.RIGHT&&!(i&Relationship.RIGHT)&&(ae=oe-(j-L)*re,r=ae>=k&&ae<=$),!r&&g&Relationship.BELOW&&!(i&Relationship.BELOW)&&(ie=j-(oe-k)/re,r=ie>=y&&ie<=L),!r&&g&Relationship.LEFT&&!(i&Relationship.LEFT)&&(ae=oe-(j-y)*re,r=ae>=k&&ae<=$)}return r}function applyTransform(t,e,n,r){if(isEmpty(t))return createOrUpdateEmpty(n);let i=[];i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]],e(i,i,2);const g=[],y=[];for(let k=0,L=i.length;k<L;k+=2)g.push(i[k]),y.push(i[k+1]);return _boundingExtentXYs(g,y,n)}function wrapX$2(t,e){const n=e.getExtent(),r=getCenter(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){const i=getWidth(n),y=Math.floor((r[0]-n[0])/i)*i;t[0]-=y,t[2]-=y}return t}function wrapAndSliceX(t,e,n){if(e.canWrapX()){const r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];wrapX$2(t,e);const i=getWidth(r);if(getWidth(t)>i&&!n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+i,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-i,t[3]]]}return[t]}class RBush{constructor(e){this.rbush_=new RBush$1(e),this.items_={}}insert(e,n){const r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:n};this.rbush_.insert(r),this.items_[getUid(n)]=r}load(e,n){const r=new Array(n.length);for(let i=0,g=n.length;i<g;i++){const y=e[i],k=n[i],L={minX:y[0],minY:y[1],maxX:y[2],maxY:y[3],value:k};r[i]=L,this.items_[getUid(k)]=L}this.rbush_.load(r)}remove(e){const n=getUid(e),r=this.items_[n];return delete this.items_[n],this.rbush_.remove(r)!==null}update(e,n){const r=this.items_[getUid(n)],i=[r.minX,r.minY,r.maxX,r.maxY];equals$1(i,e)||(this.remove(n),this.insert(e,n))}getAll(){return this.rbush_.all().map(function(n){return n.value})}getInExtent(e){const n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(n).map(function(i){return i.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,n){return this.forEach_(this.getInExtent(e),n)}forEach_(e,n){let r;for(let i=0,g=e.length;i<g;i++)if(r=n(e[i]),r)return r;return r}isEmpty(){return isEmpty$1(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){const n=this.rbush_.toJSON();return createOrUpdate$2(n.minX,n.minY,n.maxX,n.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(const n in e.items_)this.items_[n]=e.items_[n]}}function assert(t,e){if(!t)throw new Error(e)}class Feature extends BaseObject{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry=="function"){const n=e;this.setGeometry(n)}else{const n=e;this.setProperties(n)}}clone(){const e=new Feature(this.hasProperties()?this.getProperties():null);e.setGeometryName(this.getGeometryName());const n=this.getGeometry();n&&e.setGeometry(n.clone());const r=this.getStyle();return r&&e.setStyle(r),e}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);const e=this.getGeometry();e&&(this.geometryChangeKey_=listen(e,EventType.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?createStyleFunction(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function createStyleFunction(t){if(typeof t=="function")return t;let e;return Array.isArray(t)?e=t:(assert(typeof t.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}const tmp_=new Array(6);function create$2(){return[1,0,0,1,0,0]}function multiply(t,e){const n=t[0],r=t[1],i=t[2],g=t[3],y=t[4],k=t[5],L=e[0],$=e[1],V=e[2],z=e[3],j=e[4],oe=e[5];return t[0]=n*L+i*$,t[1]=r*L+g*$,t[2]=n*V+i*z,t[3]=r*V+g*z,t[4]=n*j+i*oe+y,t[5]=r*j+g*oe+k,t}function set(t,e,n,r,i,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=g,t[5]=y,t}function setFromArray(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function apply(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function translate$2(t,e,n){return multiply(t,set(tmp_,1,0,0,1,e,n))}function compose(t,e,n,r,i,g,y,k){const L=Math.sin(g),$=Math.cos(g);return t[0]=r*$,t[1]=i*L,t[2]=-r*L,t[3]=i*$,t[4]=y*r*$-k*r*L+e,t[5]=y*i*L+k*i*$+n,t}function makeInverse(t,e){const n=determinant(e);assert(n!==0,"Transformation matrix cannot be inverted");const r=e[0],i=e[1],g=e[2],y=e[3],k=e[4],L=e[5];return t[0]=y/n,t[1]=-i/n,t[2]=-g/n,t[3]=r/n,t[4]=(g*L-y*k)/n,t[5]=-(r*L-i*k)/n,t}function determinant(t){return t[0]*t[3]-t[1]*t[2]}const matrixPrecision=[1e6,1e6,1e6,1e6,2,2];function toString$1(t){return"matrix("+t.map((n,r)=>Math.round(n*matrixPrecision[r])/matrixPrecision[r]).join(", ")+")"}const METERS_PER_UNIT$1={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Projection{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent!==void 0?e.extent:null,this.worldExtent_=e.worldExtent!==void 0?e.worldExtent:null,this.axisOrientation_=e.axisOrientation!==void 0?e.axisOrientation:"enu",this.global_=e.global!==void 0?e.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||METERS_PER_UNIT$1[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const RADIUS$1=6378137,HALF_SIZE=Math.PI*RADIUS$1,EXTENT$1=[-HALF_SIZE,-HALF_SIZE,HALF_SIZE,HALF_SIZE],WORLD_EXTENT=[-180,-85,180,85],MAX_SAFE_Y=RADIUS$1*Math.log(Math.tan(Math.PI/2));class EPSG3857Projection extends Projection{constructor(e){super({code:e,units:"m",extent:EXTENT$1,global:!0,worldExtent:WORLD_EXTENT,getPointResolution:function(n,r){return n/Math.cosh(r[1]/RADIUS$1)}})}}const PROJECTIONS$1=[new EPSG3857Projection("EPSG:3857"),new EPSG3857Projection("EPSG:102100"),new EPSG3857Projection("EPSG:102113"),new EPSG3857Projection("EPSG:900913"),new EPSG3857Projection("http://www.opengis.net/def/crs/EPSG/0/3857"),new EPSG3857Projection("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fromEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r){e[g]=HALF_SIZE*t[g]/180;let y=RADIUS$1*Math.log(Math.tan(Math.PI*(+t[g+1]+90)/360));y>MAX_SAFE_Y?y=MAX_SAFE_Y:y<-MAX_SAFE_Y&&(y=-MAX_SAFE_Y),e[g+1]=y}return e}function toEPSG4326(t,e,n,r){const i=t.length;n=n>1?n:2,r=r??n,e===void 0&&(n>2?e=t.slice():e=new Array(i));for(let g=0;g<i;g+=r)e[g]=180*t[g]/HALF_SIZE,e[g+1]=360*Math.atan(Math.exp(t[g+1]/RADIUS$1))/Math.PI-90;return e}const RADIUS=6378137,EXTENT=[-180,-90,180,90],METERS_PER_UNIT=Math.PI*RADIUS/180;class EPSG4326Projection extends Projection{constructor(e,n){super({code:e,units:"degrees",extent:EXTENT,axisOrientation:n,global:!0,metersPerUnit:METERS_PER_UNIT,worldExtent:EXTENT})}}const PROJECTIONS=[new EPSG4326Projection("CRS:84"),new EPSG4326Projection("EPSG:4326","neu"),new EPSG4326Projection("urn:ogc:def:crs:OGC:1.3:CRS84"),new EPSG4326Projection("urn:ogc:def:crs:OGC:2:84"),new EPSG4326Projection("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new EPSG4326Projection("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new EPSG4326Projection("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let cache$1={};function get$3(t){return cache$1[t]||cache$1[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function add$2(t,e){cache$1[t]=e}let transforms={};function add$1(t,e,n){const r=t.getCode(),i=e.getCode();r in transforms||(transforms[r]={}),transforms[r][i]=n}function get$2(t,e){return t in transforms&&e in transforms[t]?transforms[t][e]:null}function clamp(t,e,n){return Math.min(Math.max(t,e),n)}function squaredSegmentDistance(t,e,n,r,i,g){const y=i-n,k=g-r;if(y!==0||k!==0){const L=((t-n)*y+(e-r)*k)/(y*y+k*k);L>1?(n=i,r=g):L>0&&(n+=y*L,r+=k*L)}return squaredDistance$1(t,e,n,r)}function squaredDistance$1(t,e,n,r){const i=n-t,g=r-e;return i*i+g*g}function solveLinearSystem(t){const e=t.length;for(let r=0;r<e;r++){let i=r,g=Math.abs(t[r][r]);for(let k=r+1;k<e;k++){const L=Math.abs(t[k][r]);L>g&&(g=L,i=k)}if(g===0)return null;const y=t[i];t[i]=t[r],t[r]=y;for(let k=r+1;k<e;k++){const L=-t[k][r]/t[r][r];for(let $=r;$<e+1;$++)r==$?t[k][$]=0:t[k][$]+=L*t[r][$]}}const n=new Array(e);for(let r=e-1;r>=0;r--){n[r]=t[r][e]/t[r][r];for(let i=r-1;i>=0;i--)t[i][e]-=t[i][r]*n[r]}return n}function toDegrees(t){return t*180/Math.PI}function toRadians(t){return t*Math.PI/180}function modulo(t,e){const n=t%e;return n*e<0?n+e:n}function lerp(t,e,n){return t+n*(e-t)}function toFixed(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function floor(t,e){return Math.floor(toFixed(t,e))}function ceil(t,e){return Math.ceil(toFixed(t,e))}function wrap(t,e,n){if(t>=e&&t<n)return t;const r=n-e;return((t-e)%r+r)%r+e}function add(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function equals(t,e){let n=!0;for(let r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function rotate$1(t,e){const n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,g=t[1]*n+t[0]*r;return t[0]=i,t[1]=g,t}function scale$3(t,e){return t[0]*=e,t[1]*=e,t}function squaredDistance(t,e){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function distance$1(t,e){return Math.sqrt(squaredDistance(t,e))}function wrapX$1(t,e){if(e.canWrapX()){const n=getWidth(e.getExtent()),r=getWorldsAway(t,e,n);r&&(t[0]-=r*n)}return t}function getWorldsAway(t,e,n){const r=e.getExtent();let i=0;return e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])&&(n=n||getWidth(r),i=Math.floor((t[0]-r[0])/n)),i}const DEFAULT_RADIUS=63710088e-1;function getDistance(t,e,n){n=n||DEFAULT_RADIUS;const r=toRadians(t[1]),i=toRadians(e[1]),g=(i-r)/2,y=toRadians(e[0]-t[0])/2,k=Math.sin(g)*Math.sin(g)+Math.sin(y)*Math.sin(y)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(k),Math.sqrt(1-k))}function getLengthInternal(t,e){let n=0;for(let r=0,i=t.length;r<i-1;++r)n+=getDistance(t[r],t[r+1],e);return n}function getLength(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":{y=t.getCoordinates(),g=getLengthInternal(y,n);break}case"MultiLineString":case"Polygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)g+=getLengthInternal(y[L],n);break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],V=0,z=k.length;V<z;++V)g+=getLengthInternal(k[V],n);break}case"GeometryCollection":{const j=t.getGeometries();for(L=0,$=j.length;L<$;++L)g+=getLength(j[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}function getAreaInternal(t,e){let n=0;const r=t.length;let i=t[r-1][0],g=t[r-1][1];for(let y=0;y<r;y++){const k=t[y][0],L=t[y][1];n+=toRadians(k-i)*(2+Math.sin(toRadians(g))+Math.sin(toRadians(L))),i=k,g=L}return n*e*e/2}function getArea(t,e){e=e||{};const n=e.radius||DEFAULT_RADIUS,r=e.projection||"EPSG:3857",i=t.getType();i!=="GeometryCollection"&&(t=t.clone().transform(r,"EPSG:4326"));let g=0,y,k,L,$,V,z;switch(i){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":{for(y=t.getCoordinates(),g=Math.abs(getAreaInternal(y[0],n)),L=1,$=y.length;L<$;++L)g-=Math.abs(getAreaInternal(y[L],n));break}case"MultiPolygon":{for(y=t.getCoordinates(),L=0,$=y.length;L<$;++L)for(k=y[L],g+=Math.abs(getAreaInternal(k[0],n)),V=1,z=k.length;V<z;++V)g-=Math.abs(getAreaInternal(k[V],n));break}case"GeometryCollection":{const j=t.getGeometries();for(L=0,$=j.length;L<$;++L)g+=getArea(j[L],e);break}default:throw new Error("Unsupported geometry type: "+i)}return g}const K0=.9996,E=.00669438,E2=E*E,E3=E2*E,E_P2=E/(1-E),SQRT_E=Math.sqrt(1-E),_E=(1-SQRT_E)/(1+SQRT_E),_E2=_E*_E,_E3=_E2*_E,_E4=_E3*_E,_E5=_E4*_E,M1=1-E/4-3*E2/64-5*E3/256,M2=3*E/8+3*E2/32+45*E3/1024,M3=15*E2/256+45*E3/1024,M4=35*E3/3072,P2=3/2*_E-27/32*_E3+269/512*_E5,P3=21/16*_E2-55/32*_E4,P4=151/96*_E3-417/128*_E5,P5=1097/512*_E4,R=6378137;function toLonLat$1(t,e,n){const r=t-5e5,y=(n.north?e:e-1e7)/K0/(R*M1),k=y+P2*Math.sin(2*y)+P3*Math.sin(4*y)+P4*Math.sin(6*y)+P5*Math.sin(8*y),L=Math.sin(k),$=L*L,V=Math.cos(k),z=L/V,j=z*z,oe=j*j,re=1-E*$,ie=Math.sqrt(1-E*$),ae=R/ie,le=(1-E)/re,de=E_P2*V**2,pe=de*de,ue=r/(ae*K0),he=ue*ue,Ce=he*ue,_e=Ce*ue,xe=_e*ue,Ie=xe*ue,Oe=k-z/le*(he/2-_e/24*(5+3*j+10*de-4*pe-9*E_P2))+Ie/720*(61+90*j+298*de+45*oe-252*E_P2-3*pe);let $e=(ue-Ce/6*(1+2*j+de)+xe/120*(5-2*de+28*j-3*pe+8*E_P2+24*oe))/V;return $e=wrap($e+toRadians(zoneToCentralLongitude(n.number)),-Math.PI,Math.PI),[toDegrees($e),toDegrees(Oe)]}const MIN_LATITUDE=-80,MAX_LATITUDE=84,MIN_LONGITUDE=-180,MAX_LONGITUDE=180;function fromLonLat$1(t,e,n){t=wrap(t,MIN_LONGITUDE,MAX_LONGITUDE),e<MIN_LATITUDE?e=MIN_LATITUDE:e>MAX_LATITUDE&&(e=MAX_LATITUDE);const r=toRadians(e),i=Math.sin(r),g=Math.cos(r),y=i/g,k=y*y,L=k*k,$=toRadians(t),V=zoneToCentralLongitude(n.number),z=toRadians(V),j=R/Math.sqrt(1-E*i**2),oe=E_P2*g**2,re=g*wrap($-z,-Math.PI,Math.PI),ie=re*re,ae=ie*re,le=ae*re,de=le*re,pe=de*re,ue=R*(M1*r-M2*Math.sin(2*r)+M3*Math.sin(4*r)-M4*Math.sin(6*r)),he=K0*j*(re+ae/6*(1-k+oe)+de/120*(5-18*k+L+72*oe-58*E_P2))+5e5;let Ce=K0*(ue+j*y*(ie/2+le/24*(5-k+9*oe+4*oe**2)+pe/720*(61-58*k+L+600*oe-330*E_P2)));return n.north||(Ce+=1e7),[he,Ce]}function zoneToCentralLongitude(t){return(t-1)*6-180+3}const epsgRegExes=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function zoneFromCode(t){let e=0;for(const i of epsgRegExes){const g=t.match(i);if(g){e=parseInt(g[1]);break}}if(!e)return null;let n=0,r=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(r=!0,n=e-32600),n?{number:n,north:r}:null}function makeTransformFunction(t,e){return function(n,r,i,g){const y=n.length;i=i>1?i:2,g=g??i,r||(i>2?r=n.slice():r=new Array(y));for(let k=0;k<y;k+=g){const L=n[k],$=n[k+1],V=t(L,$,e);r[k]=V[0],r[k+1]=V[1]}return r}}function makeProjection(t){return zoneFromCode(t)?new Projection({code:t,units:"m"}):null}function makeTransforms(t){const e=zoneFromCode(t.getCode());return e?{forward:makeTransformFunction(fromLonLat$1,e),inverse:makeTransformFunction(toLonLat$1,e)}:null}function warn(...t){console.warn(...t)}const transformFactories=[makeTransforms],projectionFactories=[makeProjection];let showCoordinateWarning=!0;function disableCoordinateWarning(t){showCoordinateWarning=!1}function cloneTransform(t,e){if(e!==void 0){for(let n=0,r=t.length;n<r;++n)e[n]=t[n];e=e}else e=t.slice();return e}function addProjection(t){add$2(t.getCode(),t),add$1(t,t,cloneTransform)}function addProjections(t){t.forEach(addProjection)}function get$1(t){if(typeof t!="string")return t;const e=get$3(t);if(e)return e;for(const n of projectionFactories){const r=n(t);if(r)return r}return null}function getPointResolution(t,e,n,r){t=get$1(t);let i;const g=t.getPointResolutionFunc();if(g){if(i=g(e,n),r&&r!==t.getUnits()){const y=t.getMetersPerUnit();y&&(i=i*y/METERS_PER_UNIT$1[r])}}else{const y=t.getUnits();if(y=="degrees"&&!r||r=="degrees")i=e;else{const k=getTransformFromProjections(t,get$1("EPSG:4326"));if(!k&&y!=="degrees")i=e*t.getMetersPerUnit();else{let $=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];$=k($,$,2);const V=getDistance($.slice(0,2),$.slice(2,4)),z=getDistance($.slice(4,6),$.slice(6,8));i=(V+z)/2}const L=r?METERS_PER_UNIT$1[r]:t.getMetersPerUnit();L!==void 0&&(i/=L)}}return i}function addEquivalentProjections(t){addProjections(t),t.forEach(function(e){t.forEach(function(n){e!==n&&add$1(e,n,cloneTransform)})})}function addEquivalentTransforms(t,e,n,r){t.forEach(function(i){e.forEach(function(g){add$1(i,g,n),add$1(g,i,r)})})}function createProjection(t,e){return t?typeof t=="string"?get$1(t):t:get$1(e)}function createTransformFromCoordinateTransform(t){return function(e,n,r,i){const g=e.length;r=r!==void 0?r:2,i=i??r,n=n!==void 0?n:new Array(g);for(let y=0;y<g;y+=i){const k=t(e.slice(y,y+r)),L=k.length;for(let $=0,V=i;$<V;++$)n[y+$]=$>=L?e[y+$]:k[$]}return n}}function fromLonLat(t,e){return disableCoordinateWarning(),transform(t,"EPSG:4326","EPSG:3857")}function toLonLat(t,e){const n=transform(t,"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=modulo(r+180,360)-180),n}function equivalent(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||getTransformFromProjections(t,e)===cloneTransform)&&n}function getTransformFromProjections(t,e){const n=t.getCode(),r=e.getCode();let i=get$2(n,r);if(i)return i;let g=null,y=null;for(const L of transformFactories)g||(g=L(t)),y||(y=L(e));if(!g&&!y)return null;const k="EPSG:4326";if(y)if(g)i=composeTransformFuncs(g.inverse,y.forward);else{const L=get$2(n,k);L&&(i=composeTransformFuncs(L,y.forward))}else{const L=get$2(k,r);L&&(i=composeTransformFuncs(g.inverse,L))}return i&&(addProjection(t),addProjection(e),add$1(t,e,i)),i}function composeTransformFuncs(t,e){return function(n,r,i,g){return r=t(n,r,i,g),e(r,r,i,g)}}function getTransform(t,e){const n=get$1(t),r=get$1(e);return getTransformFromProjections(n,r)}function transform(t,e,n){const r=getTransform(e,n);if(!r){const i=get$1(e).getCode(),g=get$1(n).getCode();throw new Error(`No transform available between ${i} and ${g}`)}return r(t,void 0,t.length)}function transformExtent(t,e,n,r){const i=getTransform(e,n);return applyTransform(t,i,void 0)}function toUserCoordinate(t,e){return t}function fromUserCoordinate(t,e){return showCoordinateWarning&&!equals(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(showCoordinateWarning=!1,warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function toUserExtent(t,e){return t}function fromUserExtent(t,e){return t}function addCommon(){addEquivalentProjections(PROJECTIONS$1),addEquivalentProjections(PROJECTIONS),addEquivalentTransforms(PROJECTIONS,PROJECTIONS$1,fromEPSG4326,toEPSG4326)}addCommon();function transform2D(t,e,n,r,i,g,y){g=g||[],y=y||2;let k=0;for(let L=e;L<n;L+=r){const $=t[L],V=t[L+1];g[k++]=i[0]*$+i[2]*V+i[4],g[k++]=i[1]*$+i[3]*V+i[5];for(let z=2;z<y;z++)g[k++]=t[L+z]}return g&&g.length!=k&&(g.length=k),g}function rotate(t,e,n,r,i,g,y){y=y||[];const k=Math.cos(i),L=Math.sin(i),$=g[0],V=g[1];let z=0;for(let j=e;j<n;j+=r){const oe=t[j]-$,re=t[j+1]-V;y[z++]=$+oe*k-re*L,y[z++]=V+oe*L+re*k;for(let ie=j+2;ie<j+r;++ie)y[z++]=t[ie]}return y&&y.length!=z&&(y.length=z),y}function scale$2(t,e,n,r,i,g,y,k){k=k||[];const L=y[0],$=y[1];let V=0;for(let z=e;z<n;z+=r){const j=t[z]-L,oe=t[z+1]-$;k[V++]=L+i*j,k[V++]=$+g*oe;for(let re=z+2;re<z+r;++re)k[V++]=t[re]}return k&&k.length!=V&&(k.length=V),k}function translate$1(t,e,n,r,i,g,y){y=y||[];let k=0;for(let L=e;L<n;L+=r){y[k++]=t[L]+i,y[k++]=t[L+1]+g;for(let $=L+2;$<L+r;++$)y[k++]=t[$]}return y&&y.length!=k&&(y.length=k),y}const tmpTransform$1=create$2();class Geometry extends BaseObject{constructor(){super(),this.extent_=createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=memoizeOne((e,n,r)=>{if(!r)return this.getSimplifiedGeometry(n);const i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(n)})}simplifyTransformed(e,n){return this.simplifyTransformedInternal(this.getRevision(),e,n)}clone(){return abstract()}closestPointXY(e,n,r,i){return abstract()}containsXY(e,n){const r=this.getClosestPoint([e,n]);return r[0]===e&&r[1]===n}getClosestPoint(e,n){return n=n||[NaN,NaN],this.closestPointXY(e[0],e[1],n,1/0),n}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return abstract()}getExtent(e){if(this.extentRevision_!=this.getRevision()){const n=this.computeExtent(this.extent_);(isNaN(n[0])||isNaN(n[1]))&&createOrUpdateEmpty(n),this.extentRevision_=this.getRevision()}return returnOrUpdate(this.extent_,e)}rotate(e,n){abstract()}scale(e,n,r){abstract()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return abstract()}getType(){return abstract()}applyTransform(e){abstract()}intersectsExtent(e){return abstract()}translate(e,n){abstract()}transform(e,n){const r=get$1(e),i=r.getUnits()=="tile-pixels"?function(g,y,k){const L=r.getExtent(),$=r.getWorldExtent(),V=getHeight($)/getHeight(L);compose(tmpTransform$1,$[0],$[3],V,-V,0,0,0);const z=transform2D(g,0,g.length,k,tmpTransform$1,y),j=getTransform(r,n);return j?j(z,z,k):z}:getTransform(r,n);return this.applyTransform(i),this}}class SimpleGeometry extends Geometry{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return abstract()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=this.getSimplifiedGeometryInternal(e);return n.getFlatCoordinates().length<this.flatCoordinates.length?n:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,n){this.stride=getStrideForLayout(e),this.layout=e,this.flatCoordinates=n}setCoordinates(e,n){abstract()}setLayout(e,n,r){let i;if(e)i=getStrideForLayout(e);else{for(let g=0;g<r;++g){if(n.length===0){this.layout="XY",this.stride=2;return}n=n[0]}i=n.length,e=getLayoutForStride(i)}this.layout=e,this.stride=i}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();rotate(r,0,r.length,i,e,n,r),this.changed()}}scale(e,n,r){n===void 0&&(n=e),r||(r=getCenter(this.getExtent()));const i=this.getFlatCoordinates();if(i){const g=this.getStride();scale$2(i,0,i.length,g,e,n,r,i),this.changed()}}translate(e,n){const r=this.getFlatCoordinates();if(r){const i=this.getStride();translate$1(r,0,r.length,i,e,n,r),this.changed()}}}function getLayoutForStride(t){let e;return t==2?e="XY":t==3?e="XYZ":t==4&&(e="XYZM"),e}function getStrideForLayout(t){let e;return t=="XY"?e=2:t=="XYZ"||t=="XYM"?e=3:t=="XYZM"&&(e=4),e}function transformGeom2D(t,e,n){const r=t.getFlatCoordinates();if(!r)return null;const i=t.getStride();return transform2D(r,0,r.length,i,e,n)}function deflateCoordinate(t,e,n,r){for(let i=0,g=n.length;i<g;++i)t[e++]=n[i];return e}function deflateCoordinates(t,e,n,r){for(let i=0,g=n.length;i<g;++i){const y=n[i];for(let k=0;k<r;++k)t[e++]=y[k]}return e}function deflateCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinates(t,e,n[y],r);i[g++]=L,e=L}return i.length=g,i}function deflateMultiCoordinatesArray(t,e,n,r,i){i=i||[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=deflateCoordinatesArray(t,e,n[y],r,i[g]);L.length===0&&(L[0]=e),i[g++]=L,e=L[L.length-1]}return i.length=g,i}class Circle extends SimpleGeometry{constructor(e,n,r){super(),r!==void 0&&n===void 0?this.setFlatCoordinates(r,e):(n=n||0,this.setCenterAndRadius(e,n,r))}clone(){const e=new Circle(this.flatCoordinates.slice(),void 0,this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=e-g[0],k=n-g[1],L=y*y+k*k;if(L<i){if(L===0)for(let $=0;$<this.stride;++$)r[$]=g[$];else{const $=this.getRadius()/Math.sqrt(L);r[0]=g[0]+$*y,r[1]=g[1]+$*k;for(let V=2;V<this.stride;++V)r[V]=g[V]}return r.length=this.stride,L}return i}containsXY(e,n){const r=this.flatCoordinates,i=e-r[0],g=n-r[1];return i*i+g*g<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){const n=this.flatCoordinates,r=n[this.stride]-n[0];return createOrUpdate$2(n[0]-r,n[1]-r,n[0]+r,n[1]+r,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],n=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+n*n}getType(){return"Circle"}intersectsExtent(e){const n=this.getExtent();if(intersects(e,n)){const r=this.getCenter();return e[0]<=r[0]&&e[2]>=r[0]||e[1]<=r[1]&&e[3]>=r[1]?!0:forEachCorner(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const n=this.stride,r=this.flatCoordinates[n]-this.flatCoordinates[0],i=e.slice();i[n]=i[0]+r;for(let g=1;g<n;++g)i[n+g]=e[g];this.setFlatCoordinates(this.layout,i),this.changed()}setCenterAndRadius(e,n,r){this.setLayout(r,e,0),this.flatCoordinates||(this.flatCoordinates=[]);const i=this.flatCoordinates;let g=deflateCoordinate(i,0,e,this.stride);i[g++]=i[0]+n;for(let y=1,k=this.stride;y<k;++y)i[g++]=i[y];i.length=g,this.changed()}getCoordinates(){return null}setCoordinates(e,n){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,n){const r=this.getCenter(),i=this.getStride();this.setCenter(rotate(r,0,r.length,i,e,n,r)),this.changed()}}Circle.prototype.transform;class GeometryCollection extends Geometry{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(unlistenByKey),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const e=this.geometries_;for(let n=0,r=e.length;n<r;++n)this.changeEventsKeys_.push(listen(e[n],EventType.CHANGE,this.changed,this))}clone(){const e=new GeometryCollection(cloneGeometries(this.geometries_));return e.applyProperties(this),e}closestPointXY(e,n,r,i){if(i<closestSquaredDistanceXY(this.getExtent(),e,n))return i;const g=this.geometries_;for(let y=0,k=g.length;y<k;++y)i=g[y].closestPointXY(e,n,r,i);return i}containsXY(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)if(r[i].containsXY(e,n))return!0;return!1}computeExtent(e){createOrUpdateEmpty(e);const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)extend$1(e,n[r].getExtent());return e}getGeometries(){return cloneGeometries(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[];const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].getType()===this.getType()?e=e.concat(n[r].getGeometriesArrayRecursive()):e.push(n[r]);return e}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const n=[],r=this.geometries_;let i=!1;for(let g=0,y=r.length;g<y;++g){const k=r[g],L=k.getSimplifiedGeometry(e);n.push(L),L!==k&&(i=!0)}return i?new GeometryCollection(n):(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getType(){return"GeometryCollection"}intersectsExtent(e){const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)r[i].rotate(e,n);this.changed()}scale(e,n,r){r||(r=getCenter(this.getExtent()));const i=this.geometries_;for(let g=0,y=i.length;g<y;++g)i[g].scale(e,n,r);this.changed()}setGeometries(e){this.setGeometriesArray(cloneGeometries(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){const n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].applyTransform(e);this.changed()}translate(e,n){const r=this.geometries_;for(let i=0,g=r.length;i<g;++i)r[i].translate(e,n);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function cloneGeometries(t){return t.map(e=>e.clone())}function assignClosest(t,e,n,r,i,g,y){const k=t[e],L=t[e+1],$=t[n]-k,V=t[n+1]-L;let z;if($===0&&V===0)z=e;else{const j=((i-k)*$+(g-L)*V)/($*$+V*V);if(j>1)z=n;else if(j>0){for(let oe=0;oe<r;++oe)y[oe]=lerp(t[e+oe],t[n+oe],j);y.length=r;return}else z=e}for(let j=0;j<r;++j)y[j]=t[z+j];y.length=r}function maxSquaredDelta(t,e,n,r,i){let g=t[e],y=t[e+1];for(e+=r;e<n;e+=r){const k=t[e],L=t[e+1],$=squaredDistance$1(g,y,k,L);$>i&&(i=$),g=k,y=L}return i}function arrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=maxSquaredDelta(t,e,k,r,i),e=k}return i}function multiArrayMaxSquaredDelta(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];i=arrayMaxSquaredDelta(t,e,k,r,i),e=k[k.length-1]}return i}function assignClosestPoint(t,e,n,r,i,g,y,k,L,$,V){if(e==n)return $;let z,j;if(i===0){if(j=squaredDistance$1(y,k,t[e],t[e+1]),j<$){for(z=0;z<r;++z)L[z]=t[e+z];return L.length=r,j}return $}V=V||[NaN,NaN];let oe=e+r;for(;oe<n;)if(assignClosest(t,oe-r,oe,r,y,k,V),j=squaredDistance$1(y,k,V[0],V[1]),j<$){for($=j,z=0;z<r;++z)L[z]=V[z];L.length=r,oe+=r}else oe+=r*Math.max((Math.sqrt(j)-Math.sqrt($))/i|0,1);if(g&&(assignClosest(t,n-r,e,r,y,k,V),j=squaredDistance$1(y,k,V[0],V[1]),j<$)){for($=j,z=0;z<r;++z)L[z]=V[z];L.length=r}return $}function assignClosestArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,j=n.length;z<j;++z){const oe=n[z];$=assignClosestPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe}return $}function assignClosestMultiArrayPoint(t,e,n,r,i,g,y,k,L,$,V){V=V||[NaN,NaN];for(let z=0,j=n.length;z<j;++z){const oe=n[z];$=assignClosestArrayPoint(t,e,oe,r,i,g,y,k,L,$,V),e=oe[oe.length-1]}return $}function douglasPeucker(t,e,n,r,i,g,y){const k=(n-e)/r;if(k<3){for(;e<n;e+=r)g[y++]=t[e],g[y++]=t[e+1];return y}const L=new Array(k);L[0]=1,L[k-1]=1;const $=[e,n-r];let V=0;for(;$.length>0;){const z=$.pop(),j=$.pop();let oe=0;const re=t[j],ie=t[j+1],ae=t[z],le=t[z+1];for(let de=j+r;de<z;de+=r){const pe=t[de],ue=t[de+1],he=squaredSegmentDistance(pe,ue,re,ie,ae,le);he>oe&&(V=de,oe=he)}oe>i&&(L[(V-e)/r]=1,j+r<V&&$.push(j,V),V+r<z&&$.push(V,z))}for(let z=0;z<k;++z)L[z]&&(g[y++]=t[e+z*r],g[y++]=t[e+z*r+1]);return y}function douglasPeuckerArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=douglasPeucker(t,e,V,r,i,g,y),k.push(y),e=V}return y}function snap(t,e){return e*Math.round(t/e)}function quantize(t,e,n,r,i,g,y){if(e==n)return y;let k=snap(t[e],i),L=snap(t[e+1],i);e+=r,g[y++]=k,g[y++]=L;let $,V;do if($=snap(t[e],i),V=snap(t[e+1],i),e+=r,e==n)return g[y++]=$,g[y++]=V,y;while($==k&&V==L);for(;e<n;){const z=snap(t[e],i),j=snap(t[e+1],i);if(e+=r,z==$&&j==V)continue;const oe=$-k,re=V-L,ie=z-k,ae=j-L;if(oe*ae==re*ie&&(oe<0&&ie<oe||oe==ie||oe>0&&ie>oe)&&(re<0&&ae<re||re==ae||re>0&&ae>re)){$=z,V=j;continue}g[y++]=$,g[y++]=V,k=$,L=V,$=z,V=j}return g[y++]=$,g[y++]=V,y}function quantizeArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L];y=quantize(t,e,V,r,i,g,y),k.push(y),e=V}return y}function quantizeMultiArray(t,e,n,r,i,g,y,k){for(let L=0,$=n.length;L<$;++L){const V=n[L],z=[];y=quantizeArray(t,e,V,r,i,g,y,z),k.push(z),e=V[V.length-1]}return y}function inflateCoordinates(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=e;y<n;y+=r)i[g++]=t.slice(y,y+r);return i.length=g,i}function inflateCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=inflateCoordinates(t,e,L,r,i[g]),e=L}return i.length=g,i}function inflateMultiCoordinatesArray(t,e,n,r,i){i=i!==void 0?i:[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y];i[g++]=L.length===1&&L[0]===e?[]:inflateCoordinatesArray(t,e,L,r,i[g]),e=L[L.length-1]}return i.length=g,i}function linearRing(t,e,n,r){let i=0;const g=t[n-r],y=t[n-r+1];let k=0,L=0;for(;e<n;e+=r){const $=t[e]-g,V=t[e+1]-y;i+=L*$-k*V,k=$,L=V}return i/2}function linearRings(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRing(t,e,k,r),e=k}return i}function linearRingss$1(t,e,n,r){let i=0;for(let g=0,y=n.length;g<y;++g){const k=n[g];i+=linearRings(t,e,k,r),e=k[k.length-1]}return i}class LinearRing extends SimpleGeometry{constructor(e,n){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}clone(){return new LinearRing(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,n,r,i))}getArea(){return linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LinearRing(n,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}function forEach(t,e,n,r,i){let g;for(e+=r;e<n;e+=r)if(g=i(t.slice(e-r,e),t.slice(e,e+r)),g)return g;return!1}function interpolatePoint(t,e,n,r,i,g,y){let k,L;const $=(n-e)/r;if($===1)k=e;else if($===2)k=e,L=i;else if($!==0){let V=t[e],z=t[e+1],j=0;const oe=[0];for(let ae=e+r;ae<n;ae+=r){const le=t[ae],de=t[ae+1];j+=Math.sqrt((le-V)*(le-V)+(de-z)*(de-z)),oe.push(j),V=le,z=de}const re=i*j,ie=binarySearch(oe,re);ie<0?(L=(re-oe[-ie-2])/(oe[-ie-1]-oe[-ie-2]),k=e+(-ie-2)*r):k=e+ie*r}y=y>1?y:2,g=g||new Array(y);for(let V=0;V<y;++V)g[V]=k===void 0?NaN:L===void 0?t[k+V]:lerp(t[k+V],t[k+r+V],L);return g}function lineStringCoordinateAtM(t,e,n,r,i,g){if(n==e)return null;let y;if(i<t[e+r-1])return g?(y=t.slice(e,e+r),y[r-1]=i,y):null;if(t[n-1]<i)return g?(y=t.slice(n-r,n),y[r-1]=i,y):null;if(i==t[e+r-1])return t.slice(e,e+r);let k=e/r,L=n/r;for(;k<L;){const j=k+L>>1;i<t[(j+1)*r-1]?L=j:k=j+1}const $=t[k*r-1];if(i==$)return t.slice((k-1)*r,(k-1)*r+r);const V=t[(k+1)*r-1],z=(i-$)/(V-$);y=[];for(let j=0;j<r-1;++j)y.push(lerp(t[(k-1)*r+j],t[k*r+j],z));return y.push(i),y}function lineStringsCoordinateAtM(t,e,n,r,i,g,y){if(y)return lineStringCoordinateAtM(t,e,n[n.length-1],r,i,g);let k;if(i<t[r-1])return g?(k=t.slice(0,r),k[r-1]=i,k):null;if(t[t.length-1]<i)return g?(k=t.slice(t.length-r),k[r-1]=i,k):null;for(let L=0,$=n.length;L<$;++L){const V=n[L];if(e!=V){if(i<t[e+r-1])return null;if(i<=t[V-1])return lineStringCoordinateAtM(t,e,V,r,i,!1);e=V}}return null}function linearRingContainsExtent(t,e,n,r,i){return!forEachCorner(i,function(y){return!linearRingContainsXY(t,e,n,r,y[0],y[1])})}function linearRingContainsXY(t,e,n,r,i,g){let y=0,k=t[n-r],L=t[n-r+1];for(;e<n;e+=r){const $=t[e],V=t[e+1];L<=g?V>g&&($-k)*(g-L)-(i-k)*(V-L)>0&&y++:V<=g&&($-k)*(g-L)-(i-k)*(V-L)<0&&y--,k=$,L=V}return y!==0}function linearRingsContainsXY(t,e,n,r,i,g){if(n.length===0||!linearRingContainsXY(t,e,n[0],r,i,g))return!1;for(let y=1,k=n.length;y<k;++y)if(linearRingContainsXY(t,n[y-1],n[y],r,i,g))return!1;return!0}function linearRingssContainsXY(t,e,n,r,i,g){if(n.length===0)return!1;for(let y=0,k=n.length;y<k;++y){const L=n[y];if(linearRingsContainsXY(t,e,L,r,i,g))return!0;e=L[L.length-1]}return!1}function intersectsLineString(t,e,n,r,i){const g=extendFlatCoordinates(createEmpty(),t,e,n,r);return intersects(i,g)?containsExtent(i,g)||g[0]>=i[0]&&g[2]<=i[2]||g[1]>=i[1]&&g[3]<=i[3]?!0:forEach(t,e,n,r,function(y,k){return intersectsSegment(i,y,k)}):!1}function intersectsLineStringArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){if(intersectsLineString(t,e,n[g],r,i))return!0;e=n[g]}return!1}function intersectsLinearRing(t,e,n,r,i){return!!(intersectsLineString(t,e,n,r,i)||linearRingContainsXY(t,e,n,r,i[0],i[1])||linearRingContainsXY(t,e,n,r,i[0],i[3])||linearRingContainsXY(t,e,n,r,i[2],i[1])||linearRingContainsXY(t,e,n,r,i[2],i[3]))}function intersectsLinearRingArray(t,e,n,r,i){if(!intersectsLinearRing(t,e,n[0],r,i))return!1;if(n.length===1)return!0;for(let g=1,y=n.length;g<y;++g)if(linearRingContainsExtent(t,n[g-1],n[g],r,i)&&!intersectsLineString(t,n[g-1],n[g],r,i))return!1;return!0}function intersectsLinearRingMultiArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(intersectsLinearRingArray(t,e,k,r,i))return!0;e=k[k.length-1]}return!1}function lineStringLength(t,e,n,r){let i=t[e],g=t[e+1],y=0;for(let k=e+r;k<n;k+=r){const L=t[k],$=t[k+1];y+=Math.sqrt((L-i)*(L-i)+($-g)*($-g)),i=L,g=$}return y}class LineString extends SimpleGeometry{constructor(e,n){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,n!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendCoordinate(e){extend$3(this.flatCoordinates,e),this.changed()}clone(){const e=new LineString(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(maxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,n,r,i))}forEachSegment(e){return forEach(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,n){return this.layout!="XYM"&&this.layout!="XYZM"?null:(n=n!==void 0?n:!1,lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n))}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,n){return interpolatePoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,this.stride)}getLength(){return lineStringLength(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(e){const n=[];return n.length=douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,n,0),new LineString(n,"XY")}getType(){return"LineString"}intersectsExtent(e){return intersectsLineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}class MultiLineString extends SimpleGeometry{constructor(e,n,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,n);else if(n!==void 0&&r)this.setFlatCoordinates(n,e),this.ends_=r;else{const i=e,g=[],y=[];for(let L=0,$=i.length;L<$;++L){const V=i[L];extend$3(g,V.getFlatCoordinates()),y.push(g.length)}const k=i.length===0?this.getLayout():i[0].getLayout();this.setFlatCoordinates(k,g),this.ends_=y}}appendLineString(e){extend$3(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new MultiLineString(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,n,r,i))}getCoordinateAtM(e,n,r){return this.layout!="XYM"&&this.layout!="XYZM"||this.flatCoordinates.length===0?null:(n=n!==void 0?n:!1,r=r!==void 0?r:!1,lineStringsCoordinateAtM(this.flatCoordinates,0,this.ends_,this.stride,e,n,r))}getCoordinates(){return inflateCoordinatesArray(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new LineString(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){const e=this.flatCoordinates,n=this.ends_,r=this.layout,i=[];let g=0;for(let y=0,k=n.length;y<k;++y){const L=n[y],$=new LineString(e.slice(g,L),r);i.push($),g=L}return i}getFlatMidpoints(){const e=[],n=this.flatCoordinates;let r=0;const i=this.ends_,g=this.stride;for(let y=0,k=i.length;y<k;++y){const L=i[y],$=interpolatePoint(n,r,L,g,.5);extend$3(e,$),r=L}return e}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=douglasPeuckerArray(this.flatCoordinates,0,this.ends_,this.stride,e,n,0,r),new MultiLineString(n,"XY",r)}getType(){return"MultiLineString"}intersectsExtent(e){return intersectsLineStringArray(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}class Point extends SimpleGeometry{constructor(e,n){super(),this.setCoordinates(e,n)}clone(){const e=new Point(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){const g=this.flatCoordinates,y=squaredDistance$1(e,n,g[0],g[1]);if(y<i){const k=this.stride;for(let L=0;L<k;++L)r[L]=g[L];return r.length=k,y}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return createOrUpdateFromCoordinate(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return containsXY(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,n){this.setLayout(n,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinate(this.flatCoordinates,0,e,this.stride),this.changed()}}class MultiPoint extends SimpleGeometry{constructor(e,n){super(),n&&!Array.isArray(e[0])?this.setFlatCoordinates(n,e):this.setCoordinates(e,n)}appendPoint(e){extend$3(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){const e=new MultiPoint(this.flatCoordinates.slice(),this.layout);return e.applyProperties(this),e}closestPointXY(e,n,r,i){if(i<closestSquaredDistanceXY(this.getExtent(),e,n))return i;const g=this.flatCoordinates,y=this.stride;for(let k=0,L=g.length;k<L;k+=y){const $=squaredDistance$1(e,n,g[k],g[k+1]);if($<i){i=$;for(let V=0;V<y;++V)r[V]=g[k+V];r.length=y}}return i}getCoordinates(){return inflateCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){const n=this.flatCoordinates.length/this.stride;return e<0||n<=e?null:new Point(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){const e=this.flatCoordinates,n=this.layout,r=this.stride,i=[];for(let g=0,y=e.length;g<y;g+=r){const k=new Point(e.slice(g,g+r),n);i.push(k)}return i}getType(){return"MultiPoint"}intersectsExtent(e){const n=this.flatCoordinates,r=this.stride;for(let i=0,g=n.length;i<g;i+=r){const y=n[i],k=n[i+1];if(containsXY(e,y,k))return!0}return!1}setCoordinates(e,n){this.setLayout(n,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=deflateCoordinates(this.flatCoordinates,0,e,this.stride),this.changed()}}function getInteriorPointOfArray(t,e,n,r,i,g,y){let k,L,$,V,z,j,oe;const re=i[g+1],ie=[];for(let de=0,pe=n.length;de<pe;++de){const ue=n[de];for(V=t[ue-r],j=t[ue-r+1],k=e;k<ue;k+=r)z=t[k],oe=t[k+1],(re<=j&&oe<=re||j<=re&&re<=oe)&&($=(re-j)/(oe-j)*(z-V)+V,ie.push($)),V=z,j=oe}let ae=NaN,le=-1/0;for(ie.sort(ascending),V=ie[0],k=1,L=ie.length;k<L;++k){z=ie[k];const de=Math.abs(z-V);de>le&&($=(V+z)/2,linearRingsContainsXY(t,e,n,r,$,re)&&(ae=$,le=de)),V=z}return isNaN(ae)&&(ae=i[g]),y?(y.push(ae,re,le),y):[ae,re,le]}function getInteriorPointsOfMultiArray(t,e,n,r,i){let g=[];for(let y=0,k=n.length;y<k;++y){const L=n[y];g=getInteriorPointOfArray(t,e,L,r,i,2*y,g),e=L[L.length-1]}return g}function coordinates(t,e,n,r){for(;e<n-r;){for(let i=0;i<r;++i){const g=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=g}e+=r,n-=r}}function linearRingIsClockwise(t,e,n,r){let i=0,g=t[n-r],y=t[n-r+1];for(;e<n;e+=r){const k=t[e],L=t[e+1];i+=(k-g)*(L+y),g=k,y=L}return i===0?void 0:i>0}function linearRingsAreOriented(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);if(g===0){if(i&&L||!i&&!L)return!1}else if(i&&!L||!i&&L)return!1;e=k}return!0}function linearRingssAreOriented(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g){const k=n[g];if(!linearRingsAreOriented(t,e,k,r,i))return!1;k.length&&(e=k[k.length-1])}return!0}function orientLinearRings(t,e,n,r,i){i=i!==void 0?i:!1;for(let g=0,y=n.length;g<y;++g){const k=n[g],L=linearRingIsClockwise(t,e,k,r);(g===0?i&&L||!i&&!L:i&&!L||!i&&L)&&coordinates(t,e,k,r),e=k}return e}function orientLinearRingsArray(t,e,n,r,i){for(let g=0,y=n.length;g<y;++g)e=orientLinearRings(t,e,n[g],r,i);return e}function inflateEnds(t,e){const n=[];let r=0,i=0,g;for(let y=0,k=e.length;y<k;++y){const L=e[y],$=linearRingIsClockwise(t,r,L,2);if(g===void 0&&(g=$),$===g)n.push(e.slice(i,y+1));else{if(n.length===0)continue;n[n.length-1].push(e[i])}i=y+1,r=L}return n}class Polygon extends SimpleGeometry{constructor(e,n,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,n!==void 0&&r?(this.setFlatCoordinates(n,e),this.ends_=r):this.setCoordinates(e,n)}appendLinearRing(e){this.flatCoordinates?extend$3(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const e=new Polygon(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return e.applyProperties(this),e}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(arrayMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestArrayPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,n)}getArea(){return linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRings(n,0,this.ends_,this.stride,e)):n=this.flatCoordinates,inflateCoordinatesArray(n,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const e=getCenter(this.getExtent());this.flatInteriorPoint_=getInteriorPointOfArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Point(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new LinearRing(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){const e=this.layout,n=this.flatCoordinates,r=this.ends_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y],$=new LinearRing(n.slice(g,L),e);i.push($),g=L}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingsAreOriented(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeArray(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(e),n,0,r),new Polygon(n,"XY",r)}getType(){return"Polygon"}intersectsExtent(e){return intersectsLinearRingArray(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,2),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=r.length===0?0:r[r.length-1],this.changed()}}function fromExtent(t){if(isEmpty(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],r=t[2],i=t[3],g=[e,n,e,i,r,i,r,n,e,n];return new Polygon(g,"XY",[g.length])}function linearRingss(t,e,n,r){const i=[];let g=createEmpty();for(let y=0,k=n.length;y<k;++y){const L=n[y];g=createOrUpdateFromFlatCoordinates(t,e,L[0],r),i.push((g[0]+g[2])/2,(g[1]+g[3])/2),e=L[L.length-1]}return i}class MultiPolygon extends SimpleGeometry{constructor(e,n,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){const i=e,g=[],y=[];for(let k=0,L=i.length;k<L;++k){const $=i[k],V=g.length,z=$.getEnds();for(let j=0,oe=z.length;j<oe;++j)z[j]+=V;extend$3(g,$.getFlatCoordinates()),y.push(z)}n=i.length===0?this.getLayout():i[0].getLayout(),e=g,r=y}n!==void 0&&r?(this.setFlatCoordinates(n,e),this.endss_=r):this.setCoordinates(e,n)}appendPolygon(e){let n;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),n=e.getEnds().slice(),this.endss_.push();else{const r=this.flatCoordinates.length;extend$3(this.flatCoordinates,e.getFlatCoordinates()),n=e.getEnds().slice();for(let i=0,g=n.length;i<g;++i)n[i]+=r}this.endss_.push(n),this.changed()}clone(){const e=this.endss_.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=this.endss_[i].slice();const r=new MultiPolygon(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,n,r,i){return i<closestSquaredDistanceXY(this.getExtent(),e,n)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(multiArrayMaxSquaredDelta(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),assignClosestMultiArrayPoint(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,n,r,i))}containsXY(e,n){return linearRingssContainsXY(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,n)}getArea(){return linearRingss$1(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let n;return e!==void 0?(n=this.getOrientedFlatCoordinates().slice(),orientLinearRingsArray(n,0,this.endss_,this.stride,e)):n=this.flatCoordinates,inflateMultiCoordinatesArray(n,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const e=linearRingss(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=getInteriorPointsOfMultiArray(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new MultiPoint(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const e=this.flatCoordinates;linearRingssAreOriented(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=orientLinearRingsArray(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(e){const n=[],r=[];return n.length=quantizeMultiArray(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(e),n,0,r),new MultiPolygon(n,"XY",r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let n;if(e===0)n=0;else{const g=this.endss_[e-1];n=g[g.length-1]}const r=this.endss_[e].slice(),i=r[r.length-1];if(n!==0)for(let g=0,y=r.length;g<y;++g)r[g]-=n;return new Polygon(this.flatCoordinates.slice(n,i),this.layout,r)}getPolygons(){const e=this.layout,n=this.flatCoordinates,r=this.endss_,i=[];let g=0;for(let y=0,k=r.length;y<k;++y){const L=r[y].slice(),$=L[L.length-1];if(g!==0)for(let z=0,j=L.length;z<j;++z)L[z]-=g;const V=new Polygon(n.slice(g,$),e,L);i.push(V),g=$}return i}getType(){return"MultiPolygon"}intersectsExtent(e){return intersectsLinearRingMultiArray(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,n){this.setLayout(n,e,3),this.flatCoordinates||(this.flatCoordinates=[]);const r=deflateMultiCoordinatesArray(this.flatCoordinates,0,e,this.stride,this.endss_);if(r.length===0)this.flatCoordinates.length=0;else{const i=r[r.length-1];this.flatCoordinates.length=i.length===0?0:i[i.length-1]}this.changed()}}const tmpTransform=create$2();class RenderFeature{constructor(e,n,r,i,g,y){this.styleFunction,this.extent_,this.id_=y,this.type_=e,this.flatCoordinates_=n,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r||null,this.properties_=g,this.squaredTolerance_,this.stride_=i,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?createOrUpdateFromCoordinate(this.flatCoordinates_):createOrUpdateFromFlatCoordinates(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const e=getCenter(this.getExtent());this.flatInteriorPoints_=getInteriorPointOfArray(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const e=inflateEnds(this.flatCoordinates_,this.ends_),n=linearRingss(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=getInteriorPointsOfMultiArray(this.flatCoordinates_,0,e,2,n)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=interpolatePoint(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const e=this.flatCoordinates_;let n=0;const r=this.ends_;for(let i=0,g=r.length;i<g;++i){const y=r[i],k=interpolatePoint(e,n,y,2,.5);extend$3(this.flatMidpoints_,k),n=y}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,n){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=get$1(e);const n=e.getExtent(),r=e.getWorldExtent();if(n&&r){const i=getHeight(r)/getHeight(n);compose(tmpTransform,r[0],r[3],i,-i,0,0,0),transform2D(this.flatCoordinates_,0,this.flatCoordinates_.length,2,tmpTransform,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var e;return new RenderFeature(this.type_,this.flatCoordinates_.slice(),(e=this.ends_)==null?void 0:e.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=memoizeOne((e,n)=>{if(e===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);const r=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":r.length=douglasPeucker(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,e,r,0),i=[r.length];break;case"MultiLineString":i=[],r.length=douglasPeuckerArray(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,e,r,0,i);break;case"Polygon":i=[],r.length=quantizeArray(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(e),r,0,i);break}return i&&(this.simplifiedGeometry_=new RenderFeature(this.type_,r,i,2,this.properties_,this.id_)),this.squaredTolerance_=e,this.simplifiedGeometry_}),this}}RenderFeature.prototype.getFlatCoordinates=RenderFeature.prototype.getOrientedFlatCoordinates;class Source extends BaseObject{constructor(e){super(),this.projection=get$1(e.projection),this.attributions_=adaptAttributions(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state!==void 0?e.state:"ready",this.wrapX_=e.wrapX!==void 0?e.wrapX:!1,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;const n=this;this.viewPromise_=new Promise(function(r,i){n.viewResolver=r,n.viewRejector=i})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=adaptAttributions(e),this.changed()}setState(e){this.state_=e,this.changed()}}function adaptAttributions(t){return t?typeof t=="function"?t:(Array.isArray(t)||(t=[t]),e=>t):null}const VectorEventType={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};function all$1(t,e){return[[-1/0,-1/0,1/0,1/0]]}let withCredentials=!1;function loadFeaturesXhr(t,e,n,r,i,g,y){const k=new XMLHttpRequest;k.open("GET",typeof t=="function"?t(n,r,i):t,!0),e.getType()=="arraybuffer"&&(k.responseType="arraybuffer"),k.withCredentials=withCredentials,k.onload=function(L){if(!k.status||k.status>=200&&k.status<300){const $=e.getType();try{let V;$=="text"||$=="json"?V=k.responseText:$=="xml"?V=k.responseXML||k.responseText:$=="arraybuffer"&&(V=k.response),V?g(e.readFeatures(V,{extent:n,featureProjection:i}),e.readProjection(V)):y()}catch{y()}}else y()},k.onerror=y,k.send()}function xhr(t,e){return function(n,r,i,g,y){const k=this;loadFeaturesXhr(t,e,n,r,i,function(L,$){k.addFeatures(L),g!==void 0&&g(L)},y||VOID)}}class VectorSourceEvent extends BaseEvent{constructor(e,n,r){super(e),this.feature=n,this.features=r}}class VectorSource extends Source{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0}),this.on,this.once,this.un,this.loader_=VOID,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader!==void 0?this.loader_=e.loader:this.url_!==void 0&&(assert(this.format_,"`format` must be set when `url` is set"),this.loader_=xhr(this.url_,this.format_)),this.strategy_=e.strategy!==void 0?e.strategy:all$1;const n=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;this.featuresRtree_=n?new RBush:null,this.loadedExtentsRtree_=new RBush,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let r,i;Array.isArray(e.features)?i=e.features:e.features&&(r=e.features,i=r.getArray()),!n&&r===void 0&&(r=new Collection(i)),i!==void 0&&this.addFeaturesInternal(i),r!==void 0&&this.bindFeaturesCollection_(r)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){const n=getUid(e);if(!this.addToIndex_(n,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(n,e);const r=e.getGeometry();if(r){const i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,e)}else this.nullGeometryFeatures_[n]=e;this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE,e))}setupChangeEvents_(e,n){n instanceof RenderFeature||(this.featureChangeKeys_[e]=[listen(n,EventType.CHANGE,this.handleFeatureChange_,this),listen(n,ObjectEventType.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,n){let r=!0;if(n.getId()!==void 0){const i=String(n.getId());if(!(i in this.idIndex_))this.idIndex_[i]=n;else if(n instanceof RenderFeature){const g=this.idIndex_[i];g instanceof RenderFeature?Array.isArray(g)?g.push(n):this.idIndex_[i]=[g,n]:r=!1}else r=!1}return r&&(assert(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=n),r}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){const n=[],r=[],i=[];for(let g=0,y=e.length;g<y;g++){const k=e[g],L=getUid(k);this.addToIndex_(L,k)&&r.push(k)}for(let g=0,y=r.length;g<y;g++){const k=r[g],L=getUid(k);this.setupChangeEvents_(L,k);const $=k.getGeometry();if($){const V=$.getExtent();n.push(V),i.push(k)}else this.nullGeometryFeatures_[L]=k}if(this.featuresRtree_&&this.featuresRtree_.load(n,i),this.hasListener(VectorEventType.ADDFEATURE))for(let g=0,y=r.length;g<y;g++)this.dispatchEvent(new VectorSourceEvent(VectorEventType.ADDFEATURE,r[g]))}bindFeaturesCollection_(e){let n=!1;this.addEventListener(VectorEventType.ADDFEATURE,function(r){n||(n=!0,e.push(r.feature),n=!1)}),this.addEventListener(VectorEventType.REMOVEFEATURE,function(r){n||(n=!0,e.remove(r.feature),n=!1)}),e.addEventListener(CollectionEventType.ADD,r=>{n||(n=!0,this.addFeature(r.element),n=!1)}),e.addEventListener(CollectionEventType.REMOVE,r=>{n||(n=!0,this.removeFeature(r.element),n=!1)}),this.featuresCollection_=e}clear(e){if(e){for(const r in this.featureChangeKeys_)this.featureChangeKeys_[r].forEach(unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(r=>{this.removeFeatureInternal(r)});for(const r in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[r])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const n=new VectorSourceEvent(VectorEventType.CLEAR);this.dispatchEvent(n),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,n){const r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,function(i){const g=i.getGeometry();if(g instanceof RenderFeature||g.intersectsCoordinate(e))return n(i)})}forEachFeatureInExtent(e,n){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,n);this.featuresCollection_&&this.featuresCollection_.forEach(n)}forEachFeatureIntersectingExtent(e,n){return this.forEachFeatureInExtent(e,function(r){const i=r.getGeometry();if(i instanceof RenderFeature||i.intersectsExtent(e)){const g=n(r);if(g)return g}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),isEmpty$1(this.nullGeometryFeatures_)||extend$3(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){const n=[];return this.forEachFeatureAtCoordinateDirect(e,function(r){n.push(r)}),n}getFeaturesInExtent(e,n){if(this.featuresRtree_){if(!(n&&n.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);const i=wrapAndSliceX(e,n);return[].concat(...i.map(g=>this.featuresRtree_.getInExtent(g)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,n){const r=e[0],i=e[1];let g=null;const y=[NaN,NaN];let k=1/0;const L=[-1/0,-1/0,1/0,1/0];return n=n||TRUE,this.featuresRtree_.forEachInExtent(L,function($){if(n($)){const V=$.getGeometry(),z=k;if(k=V instanceof RenderFeature?0:V.closestPointXY(r,i,y,k),k<z){g=$;const j=Math.sqrt(k);L[0]=r-j,L[1]=i-j,L[2]=r+j,L[3]=i+j}}}),g}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){const n=this.idIndex_[e.toString()];return n!==void 0?n:null}getFeatureByUid(e){const n=this.uidIndex_[e];return n!==void 0?n:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){const n=e.target,r=getUid(n),i=n.getGeometry();if(!i)r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(n),this.nullGeometryFeatures_[r]=n);else{const y=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(y,n)):this.featuresRtree_&&this.featuresRtree_.update(y,n)}const g=n.getId();if(g!==void 0){const y=g.toString();this.idIndex_[y]!==n&&(this.removeFromIdIndex_(n),this.idIndex_[y]=n)}else this.removeFromIdIndex_(n),this.uidIndex_[r]=n;this.changed(),this.dispatchEvent(new VectorSourceEvent(VectorEventType.CHANGEFEATURE,n))}hasFeature(e){const n=e.getId();return n!==void 0?n in this.idIndex_:getUid(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&isEmpty$1(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(e,n,r){const i=this.loadedExtentsRtree_,g=this.strategy_(e,n,r);for(let y=0,k=g.length;y<k;++y){const L=g[y];i.forEachInExtent(L,function(V){return containsExtent(V.extent,L)})||(++this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADSTART)),this.loader_.call(this,L,n,r,V=>{--this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADEND,void 0,V))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new VectorSourceEvent(VectorEventType.FEATURESLOADERROR))}),i.insert(L,{extent:L.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){const n=this.loadedExtentsRtree_,r=n.forEachInExtent(e,function(i){if(equals$1(i.extent,e))return i});r&&n.remove(r)}removeFeatures(e){let n=!1;for(let r=0,i=e.length;r<i;++r)n=this.removeFeatureInternal(e[r])||n;n&&this.changed()}removeFeature(e){if(!e)return;this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){const n=getUid(e);if(!(n in this.uidIndex_))return!1;n in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[n]:this.featuresRtree_&&this.featuresRtree_.remove(e);const r=this.featureChangeKeys_[n];r==null||r.forEach(unlistenByKey),delete this.featureChangeKeys_[n];const i=e.getId();if(i!==void 0){const g=i.toString(),y=this.idIndex_[g];y===e?delete this.idIndex_[g]:Array.isArray(y)&&(y.splice(y.indexOf(e),1),y.length===1&&(this.idIndex_[g]=y[0]))}return delete this.uidIndex_[n],this.hasListener(VectorEventType.REMOVEFEATURE)&&this.dispatchEvent(new VectorSourceEvent(VectorEventType.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(const n in this.idIndex_)if(this.idIndex_[n]===e){delete this.idIndex_[n];break}}setLoader(e){this.loader_=e}setUrl(e){assert(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(xhr(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}}const ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},rgb={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var xyz={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};xyz.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}},xyz.max=xyz.whitepoint[2].D65,xyz.rgb=function(t,e){e=e||xyz.whitepoint[2].E;var n=t[0]/e[0],r=t[1]/e[1],i=t[2]/e[2],g,y,k;return g=n*3.240969941904521+r*-1.537383177570093+i*-.498610760293,y=n*-.96924363628087+r*1.87596750150772+i*.041555057407175,k=n*.055630079696993+r*-.20397695888897+i*1.056971514242878,g=g>.0031308?1.055*Math.pow(g,1/2.4)-.055:g=g*12.92,y=y>.0031308?1.055*Math.pow(y,1/2.4)-.055:y=y*12.92,k=k>.0031308?1.055*Math.pow(k,1/2.4)-.055:k=k*12.92,g=Math.min(Math.max(0,g),1),y=Math.min(Math.max(0,y),1),k=Math.min(Math.max(0,k),1),[g*255,y*255,k*255]},rgb.xyz=function(t,e){var n=t[0]/255,r=t[1]/255,i=t[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var g=n*.41239079926595+r*.35758433938387+i*.18048078840183,y=n*.21263900587151+r*.71516867876775+i*.072192315360733,k=n*.019330818715591+r*.11919477979462+i*.95053215224966;return e=e||xyz.whitepoint[2].E,[g*e[0],y*e[1],k*e[2]]};const luv={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,n){var r,i,g,y,k,L,$,V,z,j,oe,re,ie;if(g=t[0],y=t[1],k=t[2],g===0)return[0,0,0];var ae=.0011070564598794539;return e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],j=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],re=4*z/(z+15*j+3*oe),ie=9*j/(z+15*j+3*oe),r=y/(13*g)+re||0,i=k/(13*g)+ie||0,$=g>8?j*Math.pow((g+16)/116,3):j*g*ae,L=$*9*r/(4*i)||0,V=$*(12-3*r-20*i)/(4*i)||0,[L,$,V]}};xyz.luv=function(t,e,n){var r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae=.008856451679035631,le=903.2962962962961;e=e||"D65",n=n||2,z=xyz.whitepoint[n][e][0],j=xyz.whitepoint[n][e][1],oe=xyz.whitepoint[n][e][2],re=4*z/(z+15*j+3*oe),ie=9*j/(z+15*j+3*oe),L=t[0],$=t[1],V=t[2],r=4*L/(L+15*$+3*V)||0,i=9*$/(L+15*$+3*V)||0;var de=$/j;return g=de<=ae?le*de:116*Math.pow(de,1/3)-16,y=13*g*(r-re),k=13*g*(i-ie),[g,y,k]};var lchuv={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e=t[0],n=t[1],r=t[2],i,g,y;return y=r/360*2*Math.PI,i=n*Math.cos(y),g=n*Math.sin(y),[e,i,g]},xyz:function(t){return luv.xyz(lchuv.luv(t))}};luv.lchuv=function(t){var e=t[0],n=t[1],r=t[2],i=Math.sqrt(n*n+r*r),g=Math.atan2(r,n),y=g*360/2/Math.PI;return y<0&&(y+=360),[e,i,y]},xyz.lchuv=function(t){return luv.lchuv(xyz.luv(t))};const names={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var baseHues={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function parse$1(t){var V,z;var e,n=[],r=1,i;if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(typeof t=="number")return{space:"rgb",values:[t>>>16,(t&65280)>>>8,t&255],alpha:1};if(t=String(t).toLowerCase(),names[t])n=names[t].slice(),i="rgb";else if(t==="transparent")r=0,i="rgb",n=[0,0,0];else if(t[0]==="#"){var g=t.slice(1),y=g.length,k=y<=4;r=1,k?(n=[parseInt(g[0]+g[0],16),parseInt(g[1]+g[1],16),parseInt(g[2]+g[2],16)],y===4&&(r=parseInt(g[3]+g[3],16)/255)):(n=[parseInt(g[0]+g[1],16),parseInt(g[2]+g[3],16),parseInt(g[4]+g[5],16)],y===8&&(r=parseInt(g[6]+g[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var L=e[1];i=L.replace(/a$/,"");var $=i==="cmyk"?4:i==="gray"?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),i==="color"&&(i=n.shift()),n=n.map(function(j,oe){if(j[j.length-1]==="%")return j=parseFloat(j)/100,oe===3?j:i==="rgb"?j*255:i[0]==="h"||i[0]==="l"&&!oe?j*100:i==="lab"?j*125:i==="lch"?oe<2?j*150:j*360:i[0]==="o"&&!oe?j:i==="oklab"?j*.4:i==="oklch"?oe<2?j*.4:j*360:j;if(i[oe]==="h"||oe===2&&i[i.length-1]==="h"){if(baseHues[j]!==void 0)return baseHues[j];if(j.endsWith("deg"))return parseFloat(j);if(j.endsWith("turn"))return parseFloat(j)*360;if(j.endsWith("grad"))return parseFloat(j)*360/400;if(j.endsWith("rad"))return parseFloat(j)*180/Math.PI}return j==="none"?0:parseFloat(j)}),r=n.length>$?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map(function(j){return parseFloat(j)}),i=((z=(V=t.match(/([a-z])/ig))==null?void 0:V.join(""))==null?void 0:z.toLowerCase())||"rgb");return{space:i,values:n,alpha:r}}const hsl={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,g,y,k,L,$=0;if(n===0)return L=r*255,[L,L,L];for(g=r<.5?r*(1+n):r+n-r*n,i=2*r-g,k=[0,0,0];$<3;)y=e+1/3*-($-1),y<0?y++:y>1&&y--,L=6*y<1?i+(g-i)*6*y:2*y<1?g:3*y<2?i+(g-i)*(2/3-y)*6:i,k[$++]=L*255;return k}};rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),g=Math.max(e,n,r),y=g-i,k,L,$;return g===i?k=0:e===g?k=(n-r)/y:n===g?k=2+(r-e)/y:r===g&&(k=4+(e-n)/y),k=Math.min(k*60,360),k<0&&(k+=360),$=(i+g)/2,g===i?L=0:$<=.5?L=y/(g+i):L=y/(2-g-i),[k,L*100,$*100]};function rgba(t){Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var e,n=parse$1(t);if(!n.space)return[];const r=n.space[0]==="h"?hsl.min:rgb.min,i=n.space[0]==="h"?hsl.max:rgb.max;return e=Array(3),e[0]=Math.min(Math.max(n.values[0],r[0]),i[0]),e[1]=Math.min(Math.max(n.values[1],r[1]),i[1]),e[2]=Math.min(Math.max(n.values[2],r[2]),i[2]),n.space[0]==="h"&&(e=hsl.rgb(e)),e.push(Math.min(Math.max(n.alpha,0),1)),e}const NO_COLOR=[NaN,NaN,NaN,0];function asString(t){return typeof t=="string"?t:toString(t)}const MAX_CACHE_SIZE=1024,cache={};let cacheSize=0;function withAlpha(t){if(t.length===4)return t;const e=t.slice();return e[3]=1,e}function rgbaToLcha(t){const e=xyz.lchuv(rgb.xyz(t));return e[3]=t[3],e}function lchaToRgba(t){const e=xyz.rgb(lchuv.xyz(t));return e[3]=t[3],e}function fromString(t){if(t==="none")return NO_COLOR;if(cache.hasOwnProperty(t))return cache[t];if(cacheSize>=MAX_CACHE_SIZE){let n=0;for(const r in cache)n++&3||(delete cache[r],--cacheSize)}const e=rgba(t);if(e.length!==4)throw new Error('failed to parse "'+t+'" as color');for(const n of e)if(isNaN(n))throw new Error('failed to parse "'+t+'" as color');return normalize(e),cache[t]=e,++cacheSize,e}function asArray(t){return Array.isArray(t)?t:fromString(t)}function normalize(t){return t[0]=clamp(t[0]+.5|0,0,255),t[1]=clamp(t[1]+.5|0,0,255),t[2]=clamp(t[2]+.5|0,0,255),t[3]=clamp(t[3],0,1),t}function toString(t){let e=t[0];e!=(e|0)&&(e=e+.5|0);let n=t[1];n!=(n|0)&&(n=n+.5|0);let r=t[2];r!=(r|0)&&(r=r+.5|0);const i=t[3]===void 0?1:Math.round(t[3]*1e3)/1e3;return"rgba("+e+","+n+","+r+","+i+")"}const ua=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",FIREFOX=ua.includes("firefox"),SAFARI=ua.includes("safari")&&!ua.includes("chrom"),SAFARI_BUG_237906=SAFARI&&(ua.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ua)),WEBKIT=ua.includes("webkit")&&!ua.includes("edge"),MAC=ua.includes("macintosh"),DEVICE_PIXEL_RATIO=typeof devicePixelRatio<"u"?devicePixelRatio:1,WORKER_OFFSCREEN_CANVAS=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,IMAGE_DECODE=typeof Image<"u"&&Image.prototype.decode,PASSIVE_EVENT_LISTENERS=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}();function createCanvasContext2D(t,e,n,r){let i;return n&&n.length?i=n.shift():WORKER_OFFSCREEN_CANVAS?i=new OffscreenCanvas(t||300,e||300):i=document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}let sharedCanvasContext;function getSharedCanvasContext2D(){return sharedCanvasContext||(sharedCanvasContext=createCanvasContext2D(1,1)),sharedCanvasContext}function releaseCanvas$1(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function outerWidth(t){let e=t.offsetWidth;const n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),e}function outerHeight(t){let e=t.offsetHeight;const n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),e}function replaceNode(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function removeChildren(t){for(;t.lastChild;)t.lastChild.remove()}function replaceChildren(t,e){const n=t.childNodes;for(let r=0;;++r){const i=n[r],g=e[r];if(!i&&!g)break;if(i!==g){if(!i){t.appendChild(g);continue}if(!g){t.removeChild(i),--r;continue}t.insertBefore(g,i)}}}function listenImage(t,e,n){const r=t;let i=!0,g=!1,y=!1;const k=[listenOnce(r,EventType.LOAD,function(){y=!0,g||e()})];return r.src&&IMAGE_DECODE?(g=!0,r.decode().then(function(){i&&e()}).catch(function(L){i&&(y?e():n())})):k.push(listenOnce(r,EventType.ERROR,n)),function(){i=!1,k.forEach(unlistenByKey)}}function load(t,e){return new Promise((n,r)=>{function i(){y(),n(t)}function g(){y(),r(new Error("Image load error"))}function y(){t.removeEventListener("load",i),t.removeEventListener("error",g)}t.addEventListener("load",i),t.addEventListener("error",g)})}function decodeFallback(t,e){return e&&(t.src=e),t.src&&IMAGE_DECODE?new Promise((n,r)=>t.decode().then(()=>n(t)).catch(i=>t.complete&&t.width?n(t):r(i))):load(t)}class IconImageCache{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(const n in this.cache_){const r=this.cache_[n];!(e++&3)&&!r.hasListener()&&(delete this.cache_[n],delete this.patternCache_[n],--this.cacheSize_)}}}get(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.cache_?this.cache_[i]:null}getPattern(e,n,r){const i=getCacheKey$1(e,n,r);return i in this.patternCache_?this.patternCache_[i]:null}set(e,n,r,i,g){const y=getCacheKey$1(e,n,r),k=y in this.cache_;this.cache_[y]=i,g&&(i.getImageState()===ImageState.IDLE&&i.load(),i.getImageState()===ImageState.LOADING?i.ready().then(()=>{this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")}):this.patternCache_[y]=getSharedCanvasContext2D().createPattern(i.getImage(1),"repeat")),k||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}}function getCacheKey$1(t,e,n){const r=n?asArray(n):"null";return e+":"+t+":"+r}const shared=new IconImageCache;let taintedTestContext=null;class IconImage extends Target{constructor(e,n,r,i,g){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=g,this.imageState_=i===void 0?ImageState.IDLE:i,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=n,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===ImageState.LOADED){taintedTestContext||(taintedTestContext=createCanvasContext2D(1,1,void 0,{willReadFrequently:!0})),taintedTestContext.drawImage(this.image_,0,0);try{taintedTestContext.getImageData(0,0,1,1),this.tainted_=!1}catch{taintedTestContext=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(EventType.CHANGE)}handleImageError_(){this.imageState_=ImageState.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=ImageState.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const e=this.size_[0],n=this.size_[1],r=createCanvasContext2D(e,n);r.fillRect(0,0,e,n),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===ImageState.IDLE){this.image_||this.initializeImage_(),this.imageState_=ImageState.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&decodeFallback(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==ImageState.LOADED)return;const n=this.image_,r=createCanvasContext2D(Math.ceil(n.width*e),Math.ceil(n.height*e)),i=r.canvas;r.scale(e,e),r.drawImage(n,0,0),r.globalCompositeOperation="multiply",r.fillStyle=asString(this.color_),r.fillRect(0,0,i.width/e,i.height/e),r.globalCompositeOperation="destination-in",r.drawImage(n,0,0),this.canvas_[e]=i}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)e();else{const n=()=>{(this.imageState_===ImageState.LOADED||this.imageState_===ImageState.ERROR)&&(this.removeEventListener(EventType.CHANGE,n),e())};this.addEventListener(EventType.CHANGE,n)}})),this.ready_}}function get(t,e,n,r,i,g){let y=e===void 0?void 0:shared.get(e,n,i);return y||(y=new IconImage(t,t&&"src"in t?t.src||void 0:e,n,r,i),shared.set(e,n,i,y,g)),g&&y&&!shared.getPattern(e,n,i)&&shared.set(e,n,i,y,g),y}function hasArea(t){return t[0]>0&&t[1]>0}function scale$1(t,e,n){return n===void 0&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function toSize(t,e){return Array.isArray(t)?t:(e===void 0?e=[t,t]:(e[0]=t,e[1]=t),e)}class ImageStyle{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=toSize(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){const e=this.getScale();return new ImageStyle({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return abstract()}getImage(e){return abstract()}getHitDetectionImage(){return abstract()}getPixelRatio(e){return 1}getImageState(){return abstract()}getImageSize(){return abstract()}getOrigin(){return abstract()}getSize(){return abstract()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=toSize(e)}listenImageChange(e){abstract()}load(){abstract()}unlistenImageChange(e){abstract()}ready(){return Promise.resolve()}}function asColorLike(t){return t?Array.isArray(t)?toString(t):typeof t=="object"&&"src"in t?asCanvasPattern(t):t:null}function asCanvasPattern(t){if(!t.offset||!t.size)return shared.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=shared.getPattern(e,void 0,t.color);if(n)return n;const r=shared.get(t.src,"anonymous",null);if(r.getImageState()!==ImageState.LOADED)return null;const i=createCanvasContext2D(t.size[0],t.size[1]);return i.drawImage(r.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),get(i.canvas,e,void 0,ImageState.LOADED,t.color,!0),shared.getPattern(e,void 0,t.color)}const CLASS_HIDDEN="ol-hidden",CLASS_SELECTABLE="ol-selectable",CLASS_UNSELECTABLE="ol-unselectable",CLASS_CONTROL="ol-control",CLASS_COLLAPSED="ol-collapsed",fontRegEx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),fontRegExMatchIndex=["style","variant","weight","size","lineHeight","family"],getFontParameters=function(t){const e=t.match(fontRegEx);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let r=0,i=fontRegExMatchIndex.length;r<i;++r){const g=e[r+1];g!==void 0&&(n[fontRegExMatchIndex[r]]=g)}return n.families=n.family.split(/,\s?/),n},defaultFont="10px sans-serif",defaultFillStyle="#000",defaultLineCap="round",defaultLineDash=[],defaultLineDashOffset=0,defaultLineJoin="round",defaultMiterLimit=10,defaultStrokeStyle="#000",defaultTextAlign="center",defaultTextBaseline="middle",defaultPadding=[0,0,0,0],defaultLineWidth=1,checkedFonts=new BaseObject;let measureContext=null,measureFont;const textHeights={},registerFont=function(){const e="32px ",n=["monospace","serif"],r=n.length,i="wmytzilWMYTZIL@#/&?$%10";let g,y;function k($,V,z){let j=!0;for(let oe=0;oe<r;++oe){const re=n[oe];if(y=measureTextWidth($+" "+V+" "+e+re,i),z!=re){const ie=measureTextWidth($+" "+V+" "+e+z+","+re,i);j=j&&ie!=y}}return!!j}function L(){let $=!0;const V=checkedFonts.getKeys();for(let z=0,j=V.length;z<j;++z){const oe=V[z];if(checkedFonts.get(oe)<100){const[re,ie,ae]=oe.split(`
54
54
  `);k(re,ie,ae)?(clear(textHeights),measureContext=null,measureFont=void 0,checkedFonts.set(oe,100)):(checkedFonts.set(oe,checkedFonts.get(oe)+1,!0),$=!1)}}$&&(clearInterval(g),g=void 0)}return function($){const V=getFontParameters($);if(!V)return;const z=V.families;for(let j=0,oe=z.length;j<oe;++j){const re=z[j],ie=V.style+`
55
55
  `+V.weight+`
56
56
  `+re;checkedFonts.get(ie)===void 0&&(checkedFonts.set(ie,100,!0),k(V.style,V.weight,re)||(checkedFonts.set(ie,0,!0),g===void 0&&(g=setInterval(L,32))))}}}(),measureTextHeight=function(){let t;return function(e){let n=textHeights[e];if(n==null){if(WORKER_OFFSCREEN_CANVAS){const r=getFontParameters(e),i=measureText(e,"Žg");n=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);textHeights[e]=n}return n}}();function measureText(t,e){return measureContext||(measureContext=createCanvasContext2D(1,1)),t!=measureFont&&(measureContext.font=t,measureFont=measureContext.font),measureContext.measureText(e)}function measureTextWidth(t,e){return measureText(t,e).width}function measureAndCacheTextWidth(t,e,n){if(e in n)return n[e];const r=e.split(`
@@ -652,8 +652,8 @@ void main(void) {
652
652
  samplePos = clamp(samplePos, vec2(0.5), sampleSize - vec2(0.5));
653
653
  samplePos.y = sampleSize.y - samplePos.y; // invert y axis so that images appear upright
654
654
  return texture2D(texture, (samplePos + textureOffset) / textureSize);
655
- }`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{}),SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,le,de,pe,ue,he,Ce,_e,xe){qn(this,"id");qn(this,"mmsi");qn(this,"fill");qn(this,"shipType");qn(this,"name");qn(this,"length");qn(this,"breadth");qn(this,"lon");qn(this,"lat");qn(this,"createdAt");qn(this,"speed");qn(this,"from");qn(this,"sailStatus");qn(this,"hdg");qn(this,"cog");qn(this,"posType");qn(this,"type");qn(this,"angle");qn(this,"leftIconColor");qn(this,"existDevice");qn(this,"existMobile");qn(this,"existWaterGauge");qn(this,"selected");qn(this,"blinkColors");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=le,this.angle=de,this.leftIconColor=pe,this.existDevice=ue,this.existMobile=he,this.existWaterGauge=Ce,this.selected=_e,this.blinkColors=xe}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name||n.id)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge,n.selected,n.blinkColors);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},_hoisted_1$a={key:0,class:"measure-panel"},_hoisted_2$6={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$6={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$c=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Oe){if(Oe.dragging)return;let $e="点击选择起点";V&&($e="单击继续,双击结束"),z&&(z.innerHTML=$e,j.setPosition(Oe.coordinate),z.classList.remove("hidden"))},le=()=>{r.value&&(r.value.on("pointermove",ae),r.value.getViewport().addEventListener("mouseout",function(){var Oe;(Oe=z==null?void 0:z.classList)==null||Oe.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function ue(){var Oe,$e;if(r.value){if(k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(qe=>{var Pt;(Pt=qe==null?void 0:qe.parentNode)==null||Pt.removeChild(qe)}),$.clear(),de){const qe=r.value.getInteractions().getArray().find(Pt=>Pt.ol_uid===de.ol_uid);qe&&((Oe=r.value)==null||Oe.removeInteraction(qe))}($e=r.value)==null||$e.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var $e,qe;ue(),($e=r.value)==null||$e.addLayer(ie),de=new Draw({source:$,type:"LineString",style:function(){return pe}}),(qe=r.value)==null||qe.addInteraction(de),_e(),Ce();let Oe;de.on("drawstart",function(Pt){var Ve;V=Pt.feature;let Lt;Oe=(Ve=V.getGeometry())==null?void 0:Ve.on("change",function(Fe){const ze=Fe.target;let Ue=formatUtils.formatLength(ze,Number(y.value));Lt=ze.getLastCoordinate(),oe&&Ue&&(oe.innerHTML=Ue),re.setPosition(Lt)})}),de.on("drawend",function(){var Pt,Lt;oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML&&(k.value.push(oe==null?void 0:oe.innerHTML),oe.innerHTML=`${oe.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((Pt=k.value)==null?void 0:Pt.length)-1}"><i class="map-iconfont icon-delete"></i></div>`),(Lt=document.querySelector(".ol-tooltip-delete-button:last-child"))==null||Lt.addEventListener("click",Ve=>{var ze;Ve.preventDefault(),Ve.stopPropagation();const Fe=(ze=Ve.target)==null?void 0:ze.getAttribute("data-index");Fe&&xe(Fe)}),re.setOffset([0,-7]),V=null,oe=null,_e(),Oe&&unByKey(Oe)})}function Ce(){var Oe;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Oe=r.value)==null||Oe.addOverlay(j)}function _e(){var Oe;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Oe=r.value)==null||Oe.addOverlay(re)}const xe=Oe=>{var Pt,Lt;k.value[Oe]&&k.value.splice(Oe,1);const $e=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");$e[Oe]&&((Lt=(Pt=$e[Oe])==null?void 0:Pt.parentNode)==null||Lt.removeChild($e[Oe]));const qe=$.getFeatures();qe[Oe]&&$.removeFeature(qe[Oe])},Ie=()=>{i("close")};return vue.watch(()=>g,()=>{g&&!L.value&&(le(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:ue}),(Oe,$e)=>g.value&&Oe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"header"},[$e[1]||($e[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$6,[$e[2]||($e[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":$e[0]||($e[0]=qe=>y.value=qe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(qe,Pt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:Pt},[vue.createElementVNode("div",_hoisted_4$2,[$e[3]||($e[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Pt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(qe),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:Lt=>xe(Pt)},$e[4]||($e[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$c,[["__scopeId","data-v-955a605e"]]),mapInstance$8=vue.ref(),renderMarkerSetInstance=t=>mapInstance$8.value=t,markerPosition=vue.ref(""),marker=vue.ref(),createIconStyle=t=>new Style({image:new Icon({src:CDN_URL+"map/poi-marker-default.png",anchor:[.5,1]}),text:new Text({text:t,offsetY:-90,font:"12px",fill:new Fill({color:"#000"}),stroke:new Stroke({color:"#fff",width:2}),backgroundFill:new Fill({color:"#fff"}),backgroundStroke:new Stroke({color:"#000",width:1}),padding:[2,2,2,2]})}),renderMarker=(t,e=!0,n=!0)=>{var V;if(!mapInstance$8.value||!t||t.split(",").length!==2)return;const[r,i]=t.split(",").map(Number);marker.value=new Feature({geometry:new Point(fromLonLat([r,i]))});const g=n?`${r}, ${i}`:"";(V=marker.value)==null||V.setStyle(createIconStyle(g));const y=new VectorSource({features:[marker.value]}),k=new VectorLayer({source:y}),L=mapInstance$8.value.getView();if(mapInstance$8.value.addLayer(k),e){const z=new Translate({layers:[k]});z.on("translating",function(j){var ie;const oe=j.features.item(0).getGeometry().getCoordinates(),re=toLonLat(oe);markerPosition.value=`${re[0].toFixed(6)}, ${re[1].toFixed(6)}`,(ie=marker.value)==null||ie.setStyle(createIconStyle(markerPosition.value))}),mapInstance$8.value.addInteraction(z)}const $=new Point([r,i]);L.setCenter(transform($.getCoordinates(),projection.data,projection.mercator)),L.setZoom(mapZoom.findShip)},setMarkerPosition=t=>{var i,g;if(!mapInstance$8.value)return;const e=mapInstance$8.value.getView(),n=t.split(",").map(Number);(g=(i=marker.value)==null?void 0:i.getGeometry())==null||g.setCoordinates(fromLonLat([n[0],n[1]]));const r=new Point([n[0],n[1]]);e.setCenter(transform(r.getCoordinates(),projection.data,projection.mercator)),e.setZoom(mapZoom.markerPosition)},CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",zhongkeKey="15c81cc0a191a232e0a0ca1a51c3ca81",baseMap={tiandituTile:`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18,markerPosition:14},renderShipsLimit=200,mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"},LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss",DEFAULT_VALUE="--";vue.ref();const shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1);function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(Ce,_e){return(y(_e,Ce)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),le=i(ie[0]),de=i(re[1]),pe=i(ie[1]),ue=Math.sin(le-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(le-ae);return r(Math.atan2(ue,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},labelAlpha=.8,labelFont="500 12px Arial",labelOutSize=2,labelHeight=10,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L,$=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){let g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,leftIcon:L,shipColor:$,lineLength:V=20,selected:z}=n;t.save(),r&&(t.font=r);let j=t.measureText(k).width+2*i;(L||$)&&(j+=g+4*i),t.restore();let oe,re=20,ie=-1,ae=g+3*i;if(V)for(let le=0;le<8;le++){oe=calculateBounds(y,le,j,ae,V);let de=!1;for(let pe=0;pe<e.length;++pe){let ue=e[pe].bounds,he=[ue[0]-re,ue[1]-re,ue[2]+re,ue[3]+re];if(oe&&isOverlapping(oe,he)){de=!0;break}}if(!de){ie=le;break}}else ie=0,oe=calculateBounds(y,ie,j,ae,V);if(z&&ie===-1&&(ie=0),oe&&ie>-1){let le=getBottomLeftPoint(oe),de=getTopRighttPoint(oe);return{center:y,x:calculateAnchorPoint(y,ie,j,ae,V),l:de,r:le,bounds:oe,position:ie,name:k}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font="22px map-iconfont";let V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-4,$+4),L+=22}if(y!=null&&y.length){t.font="12px map-iconfont",t.fillStyle="#3370ff";let V=t.measureText(r).width+6;y.forEach((z,j)=>{let oe=getIconFont(z),re=20*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}};let intervalId=[];const drawLabel=(t,e,n)=>{var z,j;let{center:r,text:i,color:g,textColor:y,bgColor:k,leftIcon:L,rightIcons:$,type:V}=e;if(r&&i){let oe={font:labelFont,labelOutSize,labelHeight,center:r,text:i,leftIcon:L,selected:e.selected};(z=e.blinkColors)!=null&&z.length&&(k=e.fill,y=getForegroundColor(e.fill));let re=drawLabelBody(t,n,oe);if(re){const{x:ie,bounds:ae,l:le}=re;let de=[getTopLeftPoint(ae),getBottomLeftPoint(ae),getBottomRightPoint(ae),getTopRighttPoint(ae)];n.find(xe=>xe.name===i)||n.push(re),drawPolygon(t,{points:[r,ie],strokeColor:g,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),$!=null&&$.length&&$.forEach(()=>{de[1][0]+=20,de[2][0]+=20});const ue={points:de,strokeColor:g,fillColor:k,shouldClosePath:!0},[he,Ce]=le,_e={center:[he,Ce+labelOutSize+labelHeight+1],text:i,textColor:y,leftIcon:L,rightIcons:$,blinkColors:e.blinkColors};if(drawPolygon(t,ue),drawText(t,_e),((j=e==null?void 0:e.blinkColors)==null?void 0:j.length)>0){let xe=Date.now(),Ie=0;const Oe=[];e.blinkColors.forEach($e=>{Oe.push($e),Oe.push("white")}),intervalId[e.id]&&clearInterval(intervalId[e.id]),intervalId[e.id]=setInterval(()=>{const $e=Date.now();$e-xe>=500&&(Ie=(Ie+1)%Oe.length,xe=$e,ue.fillColor=Oe[Ie],drawPolygon(t,ue),_e.textColor=getForegroundColor(ue.fillColor),drawText(t,_e))},10)}else shipLabels.value.find(Ie=>Ie.name===i)&&(clearInterval(intervalId[e.id]),drawPolygon(t,ue),drawText(t,_e))}}return null},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35),g=n/180*PI,y=Math.sin(g);y=1-ee*y*y;let k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);let L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){let n={lon:0,lat:0},r=t[0]/equatorialCircumference*180,i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,le]=ie;e=Math.min(e,le),n=Math.max(n,le),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$7=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$7.value=t,stopIcon="&#xe6e2;",stopColor="#E31818",slowIcon="&#xe703;",slowColor="#1890FF",dropletsIcon="&#xe6d2",trackList$1=vue.ref([]),renderTrackLine=(t,e,n)=>{var g,y,k;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[],trackList$1.value=r.map((L,$)=>(L.center=[L.lon,L.lat],L.centerPoint=transformUtils.lonLatToMercator(L.center),L.id=e,L.index=$,L.time=hooks(L.createdAt).format("YYYY-MM-DD HH:mm:ss"),L));let i=trackList$1.value.map(L=>L.centerPoint);if(i.length>=2){let L=new LineString(i);const $=new Feature({geometry:L});$.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),$.setId(e),$.set("type","line"),(y=(g=shipTrackVectorLayer.value)==null?void 0:g.getSource())==null||y.clear(),shipTrackLineFeatures.value=[];const V=shipTrackLineFeatures.value.findIndex(z=>z.getId()===e);V>=0?shipTrackLineFeatures.value[V]=$:shipTrackLineFeatures.value.push($),createAnimatedIconFeature(n,i),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value}),renderPoint(n),(k=mapInstance$7.value)==null||k.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[String(t)];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=(t,e)=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),delete allTracks.value[e]),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z;const n=Number(50*e),r=t.frameState.time,i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;geoMarkerStyle.getText().setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(z=mapInstance$7.value)==null||z.render()},startAnimation=()=>{trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=startMarker.getGeometry().clone(),vectorLayer.on("postrender",moveFeatureHandler),geoMarker.setGeometry(null)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker.setGeometry(null),vectorLayer.un("postrender",moveFeatureHandler),(t=mapInstance$7.value)==null||t.removeLayer(vectorLayer),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var n;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())}),position=startMarker.getGeometry().clone(),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(n=mapInstance$7.value)==null||n.addLayer(vectorLayer),moveFeatureHandler=r=>moveFeature(r,e),startAnimation()},renderPoint=t=>{if(!mapInstance$7.value)return;let e=trackList$1.value||[];if(!(e&&e.length>1))return[];let n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;let L=mapInstance$7.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);let V=mapInstance$7.value.getView().getZoom();if(!V)return;if(V>15){let j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;let $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle([new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})]),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){let oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");let re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];Number(k.state)===0?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):Number(k.state)===1&&((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i,g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{let k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){let[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){let k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="&#xe69b;",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{let g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value)}}),triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),mapInstance$6=vue.ref(),renderShipStyleSetInstance=t=>mapInstance$6.value=t,speedCondition=[[1,10],[10,20],[20,1/0]],drawShipModelByZoom={14:[200,30],15:[115,15],16:[55,8],17:[25,5],18:[1,1]},setShipStyle=t=>new Style({renderer:(e,n)=>{const r=n.context,i=n.feature.get("data"),g=i.length/2;r.beginPath(),r.arc(e[0],e[1],g,0,2*Math.PI),r.fillStyle="rgba(0, 0, 0, 0.01)",r.fill(),n.feature.get("index")===0&&(shipLabels.value=[]);try{const k=drawShipBody(r,i,e);k&&(drawHeading(r,i,k),t&&(drawSelectBounds(r,k),i.selected=!0)),drawShipLabel(r,i,e)}catch{return!1}}}),drawShipBody=(t,e,n)=>{if(!mapInstance$6.value)return;const r=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(!r)return;let i=[];const[g,y]=drawShipModelByZoom[r]||[0,0],[k,L]=n;if(r<=mapZoom.shipModelMax&&r>mapZoom.shipModelMin&&e.length>=g&&e.breadth>=y)i=rotateShapeModel(drawCurrentShipShapeModel(e,r),e.angle).map(V=>{const[z,j]=V;return[k+z,L+j]});else{const $=rotateShapeModel(triangleModel,e.angle);n.length===2&&(i=$.map(V=>{const[z,j]=V;return[k+z,L+j]}))}if(!(i.length>2))return!1;t.save(),t.beginPath(),t.moveTo(i[0][0],i[0][1]);for(let $=1;$<i.length;$++)t.lineTo(i[$][0],i[$][1]);return t.closePath(),t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),i},drawHeading=(t,e,n)=>{const[r,i]=n[0],g=getShipDirectPath(e);if(g){let y=g.map(function(k){let[L,$]=k;return[L+r,$+i]});if(t.save(),t.beginPath(),e.angle>0){t.translate(r,i);const k=e.angle*Math.PI/180;t.rotate(k),t.translate(-r,-i)}t.moveTo(r,i);for(let k=1;k<y.length;k++){let[L,$]=y[k];t.lineTo(L,$)}t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=4;n-=y,r-=y,i+=y,g+=y,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4;const k=8;t.beginPath(),t.moveTo(n+k,g),t.lineTo(n,g),t.lineTo(n,g-k),t.moveTo(n,r+k),t.lineTo(n,r),t.lineTo(n+k,r),t.moveTo(i-k,r),t.lineTo(i,r),t.lineTo(i,r+k),t.moveTo(i,g-k),t.lineTo(i,g),t.lineTo(i-k,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{if(!e.selected&&shipLabels.value.find(z=>z.name===e.name))return;const[r,i]=n,g=r-0,y=i-0,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:"&#xe599;"});let $=getShipCustomIcon(e);const V={id:e.id,center:[g,y],text:k,fill:e.fill,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,blinkColors:e.blinkColors,type:"ShipName"};drawLabel(t,V,shipLabels.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{let{speed:e,hdg:n,cog:r}=t,i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(let y in speedCondition){let k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{let e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e||[]},TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
656
- `);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),j=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,re,ie,ae)=>this.getTileInternal(oe,re,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return j.key=L,j}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const mapInstance$5=vue.ref(),renderShipSetInstance=t=>mapInstance$5.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null);let selectShipsVectorSource;const renderShips=t=>{var n,r,i,g;if(!mapInstance$5.value||showTrackLayer.value)return;const e=Math.round(Number(mapInstance$5.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(y=>{}),!(!e||e<mapZoom.shipGreenDotMax)&&(allShips.value=t,!hiddenOrther.value))return e>=mapZoom.shipGreenDotMax&&e<mapZoom.shipModelMin?((n=shipsLayer.value)==null||n.setVisible(!1),(r=largeAmountShipsLayer.value)==null||r.setVisible(!0),renderLargeAmountShips(t)):((i=largeAmountShipsLayer.value)==null||i.setVisible(!1),(g=shipsLayer.value)==null||g.setVisible(!0),renderShipsMarker(t))},renderLargeAmountShips=t=>{if(!mapInstance$5.value)return;const e=t.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:[n.lon,n.lat]},properties:n}));return largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})}),largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":["case",["==",["get","fill"],"#D9001C"],"#D9001C",["==",["get","fill"],"#04C900"],"#04C900","#04C900"],"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":"#000000","shape-stroke-width":.5}}),mapInstance$5.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{var n;if(!mapInstance$5.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((r,i)=>{const g=[r.lon,r.lat],y=new Feature({geometry:new Point(fromLonLat(g))}),k=1;y.set("clickGeometry",new Circle(fromLonLat(g),k)),y.set("data",r),y.set("index",i),y.setStyle(setShipStyle(!1)),shipsMarkerList.push({ship:r,lonlat:g,feature:y})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(r=>r.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource}),(n=mapInstance$5.value)==null||n.addLayer(shipsLayer.value),shipsLayer.value},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;let r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$5.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",selectSingleShipData.value),r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$5.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),selectShipsLayer.value},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,i.id):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(!t||!mapInstance$5.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r?selectedShipData.value=r.get("data"):e&&(selectedShipData.value=e),!e){console.error("找不到船舶");return}if(n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$5.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return selectSingleShipMarker(e),r},clearSelectFeature=()=>{var t;if(selectedShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,mapInstance$5.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$5.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1)},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},mapInstance$4=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$4.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1)=>{var V,z;if(!e||!mapInstance$4.value)return;document.querySelectorAll(".truck-custom-content").forEach(j=>j.parentNode.removeChild(j));const g=document.createElement("div");g.innerHTML=n;const y=new Overlay({element:g,position:e,positioning:r,stopEvent:i});if(i){let j=!1,oe=[0,0],re=[0,0];g.addEventListener("mousedown",function(ie){var ae;j=!0,ie.clientX,ie.clientY,oe=(ae=mapInstance$4.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-200,ie.clientY-200]),re=[ie.clientX-g.getBoundingClientRect().left+160,ie.clientY-g.getBoundingClientRect().top+84],ie.preventDefault()}),document.addEventListener("mousemove",function(ie){var ae;if(j){let le=(ae=mapInstance$4.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-re[0],ie.clientY-re[1]]),de=le[0]-oe[0],pe=le[1]-oe[1];y.setPosition([oe[0]+de,oe[1]+pe])}}),document.addEventListener("mouseup",function(){j=!1})}(V=mapInstance$4.value)==null||V.addOverlay(y);const k=g.querySelector(".close-button");k&&k.addEventListener("click",()=>{var j,oe;(j=mapInstance$4.value)==null||j.removeOverlay(y),(oe=g.parentNode)==null||oe.removeChild(g)});let L=JSON.parse(JSON.stringify(e));const $=(z=mapInstance$4.value)==null?void 0:z.getCoordinateFromPixel(L);return y.setPosition($),y},mapInstance$3=vue.ref(),renderTrackSetInstance=t=>mapInstance$3.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(vue.nextTick(()=>{hiddenAllShips()}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}let g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$3.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))}),renderTrackPointPopup()}).then(()=>{})},renderTrackPointPopup=()=>{var e;const t=vue.ref(null);(e=mapInstance$3.value)==null||e.on("pointermove",n=>{var i,g,y,k;t.value&&((i=mapInstance$3.value)==null||i.removeOverlay(t.value));const r=(g=mapInstance$3.value)==null?void 0:g.forEachFeatureAtPixel(n.pixel,L=>L);if(r){const L=r.get("data");if(!(L!=null&&L.time))return;let $="";L!=null&&L.stayTime&&($=`
655
+ }`;const $=`u_texture${g}`;let V="1.";"fill-color"in t&&(V=e.getFillColorExpression()),e.setFillColorExpression(`${V} * sampleFillPattern(${$}, ${y}, ${L}, ${k}, pxOrigin, pxPos)`)}}function parseLiteralStyle(t,e){const n=newCompilationContext(),r={...newCompilationContext(),inFragmentShader:!0,variables:n.variables},i=new ShaderBuilder,g={};if("icon-src"in t?parseIconProperties(t,i,g,n,r):"shape-points"in t?parseShapeProperties(t,i,g,n,r):"circle-radius"in t&&parseCircleProperties(t,i,g,n,r),parseStrokeProperties(t,i,g,n,r),parseFillProperties(t,i,g,n,r),t.filter){const L=expressionToGlsl(r,t.filter,BooleanType);i.setFragmentDiscardExpression(`!${L}`)}for(const L in r.variables){const $=r.variables[L],V=uniformNameForVariable($.name);let z=getGlslTypeFromType($.type);$.type===ColorType&&(z="vec4"),i.addUniform(`${z} ${V}`),g[V]=()=>{const j=e[$.name];return typeof j=="number"?j:typeof j=="boolean"?j?1:0:$.type===ColorType?asArray(j||"#eee"):typeof j=="string"?getStringNumberEquivalent(j):j}}for(const L in r.properties){const $=r.properties[L];n.properties[L]||(n.properties[L]=$);let V=getGlslTypeFromType($.type),z=`a_prop_${$.name}`;$.type===ColorType&&(V="vec4",z=`unpackColor(${z})`,i.addVertexShaderFunction(UNPACK_COLOR_FN)),i.addVarying(`v_prop_${$.name}`,V,z)}for(const L in n.properties){const $=n.properties[L];i.addAttribute(`${getGlslTypeFromType($.type)} a_prop_${$.name}`)}for(const L in n.functions)i.addVertexShaderFunction(n.functions[L]);for(const L in r.functions)i.addFragmentShaderFunction(r.functions[L]);const y={};for(const L in n.properties){const $=n.properties[L],V=z=>{const j=z.get($.name);return $.type===ColorType?packColor([...asArray(j||"#eee")]):typeof j=="string"?getStringNumberEquivalent(j):typeof j=="boolean"?j?1:0:j};y[`prop_${$.name}`]={size:getGlslSizeFromType($.type),callback:V}}function k(L,$,V,z){const j=n[L],oe=r[L];if(!j&&!oe)return;const re=getGlslTypeFromType(V),ie=getGlslSizeFromType(V);i.addAttribute(`${re} a_${$}`),oe&&i.addVarying(`v_${$}`,re,`a_${$}`),y[$]={size:ie,callback:z}}return k("geometryType",GEOMETRY_TYPE_PROPERTY_NAME,StringType,L=>getStringNumberEquivalent(computeGeometryType(L.getGeometry()))),k("featureId",FEATURE_ID_PROPERTY_NAME,StringType|NumberType,L=>{const $=L.getId()??null;return typeof $=="string"?getStringNumberEquivalent($):$}),{builder:i,attributes:y,uniforms:g}}class WebGLPointsLayer extends Layer{constructor(e){const n=Object.assign({},e);super(n),this.styleVariables_=e.variables||{},this.parseResult_=parseLiteralStyle(e.style,this.styleVariables_),this.hitDetectionDisabled_=!!e.disableHitDetection}createRenderer(){const e=Object.keys(this.parseResult_.attributes).map(n=>({name:n,...this.parseResult_.attributes[n]}));return new WebGLPointsLayerRenderer(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:e})}updateStyleVariables(e){Object.assign(this.styleVariables_,e),this.changed()}}var CAR_COLOR=(t=>(t[t.BLUE=1]="BLUE",t[t.YELLOW=2]="YELLOW",t[t.Y_GREEN=3]="Y_GREEN",t))(CAR_COLOR||{}),DEVICE_TYPE=(t=>(t[t.HOST=1]="HOST",t[t.TALK=2]="TALK",t[t.STORAGE=3]="STORAGE",t[t.INTERNET=4]="INTERNET",t[t.CAMERA=5]="CAMERA",t[t.LOAD=6]="LOAD",t))(DEVICE_TYPE||{}),LENGTH_UNIT=(t=>(t[t.M=1]="M",t[t.KM=2]="KM",t[t.NM=3]="NM",t))(LENGTH_UNIT||{}),SWITCH_BTN=(t=>(t.Camera="camera",t.Mobile="mobile",t.WaterGauge="waterGauge",t))(SWITCH_BTN||{}),SHIP_SAIL_STATUS=(t=>(t[t.发动机使用中=0]="发动机使用中",t[t.锚泊=1]="锚泊",t[t.未操作=2]="未操作",t[t.操纵能力受限=3]="操纵能力受限",t[t.吃水受限=4]="吃水受限",t[t.系泊=5]="系泊",t[t.搁浅=6]="搁浅",t[t.从事捕捞=7]="从事捕捞",t[t.航行中=8]="航行中",t[t.留作将来修正导航状态=9]="留作将来修正导航状态",t[t.高速船留用=10]="高速船留用",t[t.机动船尾推作业=11]="机动船尾推作业",t[t.机动船顶推或侧推作业=12]="机动船顶推或侧推作业",t[t.飞翼船留用=13]="飞翼船留用",t[t.现行的=14]="现行的",t[t.未定义=15]="未定义",t))(SHIP_SAIL_STATUS||{});class ShipMapData{constructor(e,n,r,i,g,y,k,L,$,V,z,j,oe,re,ie,ae,le,de,pe,ue,he,Ce,_e,xe){qn(this,"id");qn(this,"mmsi");qn(this,"fill");qn(this,"shipType");qn(this,"name");qn(this,"length");qn(this,"breadth");qn(this,"lon");qn(this,"lat");qn(this,"createdAt");qn(this,"speed");qn(this,"from");qn(this,"sailStatus");qn(this,"hdg");qn(this,"cog");qn(this,"posType");qn(this,"type");qn(this,"angle");qn(this,"leftIconColor");qn(this,"existDevice");qn(this,"existMobile");qn(this,"existWaterGauge");qn(this,"selected");qn(this,"blinkColors");this.id=e,this.mmsi=n,this.fill=r,this.shipType=i,this.name=g,this.length=y,this.breadth=k,this.lon=L,this.lat=$,this.createdAt=V,this.speed=z,this.from=j,this.sailStatus=oe,this.hdg=re,this.cog=ie,this.posType=ae,this.type=le,this.angle=de,this.leftIconColor=pe,this.existDevice=ue,this.existMobile=he,this.existWaterGauge=Ce,this.selected=_e,this.blinkColors=xe}}const formatLength=function(t,e){const r=getLength(t);let i="";switch(e){case LENGTH_UNIT.M:i=Math.round(r*100)/100+" m";break;case LENGTH_UNIT.KM:i=Math.round(r/1e3*100)/100+" km";break;case LENGTH_UNIT.NM:i=(Math.round(r/1e3*100)/100/1.852).toFixed(2)+" nm";break}return i},convertSixHundredThousandToLatLng=function(t,e){const n=Number(e)/6e5;return[Number(t)/6e5,n]},formatArea=(t,e)=>{const r=getArea(t);let i;switch(e){case LENGTH_UNIT.KM:r>1e4?i=Math.round(r/1e6*100)/100+" km<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break;case LENGTH_UNIT.NM:const g=Math.pow(1.852,2);r>1e4?i=Math.round(r/1e6/g*100)/100+" nm<sup>2</sup>":i=Math.round(r*100)/100+" m<sup>2</sup>";break}return i},convertShipMapData=t=>{const e=n=>new ShipMapData(n.id,n.id,n.fill||"#04C900","70",(n.cnname||n.enname||n.name||n.id)+`${n.existName?n.existName:""}`,n.len||n.length,n.wid||n.breadth,n.lon,n.lat,new Date().getTime(),n.spd,n.from,n.status,Number(n.hdg),n.cog,Number(n.postype),"other",n.cog,n.leftIconColor,n.existDevice,n.existMobile,n.existWaterGauge,n.selected,n.blinkColors);return Array.isArray(t)?t.map(n=>e(n)):e(t)},formatUtils={formatLength,convertSixHundredThousandToLatLng,formatArea},_hoisted_1$a={key:0,class:"measure-panel"},_hoisted_2$6={class:"d-flex justify-content-between align-content-start w-100"},_hoisted_3$6={class:"measure-history-list"},_hoisted_4$2={class:"left-panel"},_hoisted_5$2={class:"text index"},_hoisted_6$2={class:"text"},_hoisted_7$2=["onClick"],_sfc_main$c=vue.defineComponent({__name:"measure",props:vue.mergeModels({viewMode:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:vue.mergeModels(["close"],["update:visible"]),setup(t,{expose:e,emit:n}){const r=vue.inject("mapInstance"),i=n,g=vue.useModel(t,"visible"),y=vue.ref("3"),k=vue.ref([]),L=vue.ref(!1),$=new VectorSource;let V,z,j,oe,re;const ie=new VectorLayer({source:$,style:{"fill-color":"rgba(255, 255, 255, 0.2)","stroke-color":"#ffcc33","stroke-width":2,"circle-radius":7,"circle-fill-color":"#ffcc33"}}),ae=function(Oe){if(Oe.dragging)return;let $e="点击选择起点";V&&($e="单击继续,双击结束"),z&&(z.innerHTML=$e,j.setPosition(Oe.coordinate),z.classList.remove("hidden"))},le=()=>{r.value&&(r.value.on("pointermove",ae),r.value.getViewport().addEventListener("mouseout",function(){var Oe;(Oe=z==null?void 0:z.classList)==null||Oe.add("hidden")}),L.value=!0)};let de;const pe=new Style({fill:new Fill({color:"rgba(255, 255, 255, 0.2)"}),stroke:new Stroke({color:"rgba(255,204,51)",lineDash:[10,10],width:2}),image:new CircleStyle({radius:5,stroke:new Stroke({color:"rgba(0, 0, 0, 0.7)"}),fill:new Fill({color:"rgba(255, 255, 255, 0.2)"})})});function ue(){var Oe,$e;if(r.value){if(k.value=[],document.querySelectorAll(".ol-tooltip.ol-tooltip-static").forEach(qe=>{var Pt;(Pt=qe==null?void 0:qe.parentNode)==null||Pt.removeChild(qe)}),$.clear(),de){const qe=r.value.getInteractions().getArray().find(Pt=>Pt.ol_uid===de.ol_uid);qe&&((Oe=r.value)==null||Oe.removeInteraction(qe))}($e=r.value)==null||$e.removeLayer(ie),z!=null&&z.parentNode&&z.parentNode.removeChild(z),oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe)}}function he(){var $e,qe;ue(),($e=r.value)==null||$e.addLayer(ie),de=new Draw({source:$,type:"LineString",style:function(){return pe}}),(qe=r.value)==null||qe.addInteraction(de),_e(),Ce();let Oe;de.on("drawstart",function(Pt){var Ve;V=Pt.feature;let Lt;Oe=(Ve=V.getGeometry())==null?void 0:Ve.on("change",function(Fe){const ze=Fe.target;let Ue=formatUtils.formatLength(ze,Number(y.value));Lt=ze.getLastCoordinate(),oe&&Ue&&(oe.innerHTML=Ue),re.setPosition(Lt)})}),de.on("drawend",function(){var Pt,Lt;oe&&(oe.className="ol-tooltip ol-tooltip-static ol-tooltip-measure"),oe!=null&&oe.innerHTML&&(k.value.push(oe==null?void 0:oe.innerHTML),oe.innerHTML=`${oe.innerHTML}<div class="ol-tooltip-delete-button" data-index="${((Pt=k.value)==null?void 0:Pt.length)-1}"><i class="map-iconfont icon-delete"></i></div>`),(Lt=document.querySelector(".ol-tooltip-delete-button:last-child"))==null||Lt.addEventListener("click",Ve=>{var ze;Ve.preventDefault(),Ve.stopPropagation();const Fe=(ze=Ve.target)==null?void 0:ze.getAttribute("data-index");Fe&&xe(Fe)}),re.setOffset([0,-7]),V=null,oe=null,_e(),Oe&&unByKey(Oe)})}function Ce(){var Oe;z!=null&&z.parentNode&&z.parentNode.removeChild(z),z=document.createElement("div"),z.className="ol-tooltip hidden",j=new Overlay({element:z,offset:[15,0],positioning:"center-left"}),(Oe=r.value)==null||Oe.addOverlay(j)}function _e(){var Oe;oe!=null&&oe.parentNode&&oe.parentNode.removeChild(oe),oe=document.createElement("div"),oe.className="ol-tooltip ol-tooltip-measure",re=new Overlay({element:oe,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(Oe=r.value)==null||Oe.addOverlay(re)}const xe=Oe=>{var Pt,Lt;k.value[Oe]&&k.value.splice(Oe,1);const $e=document.querySelectorAll(".ol-tooltip.ol-tooltip-static.ol-tooltip-measure");$e[Oe]&&((Lt=(Pt=$e[Oe])==null?void 0:Pt.parentNode)==null||Lt.removeChild($e[Oe]));const qe=$.getFeatures();qe[Oe]&&$.removeFeature(qe[Oe])},Ie=()=>{i("close")};return vue.watch(()=>g,()=>{g.value&&!L.value&&(le(),he())},{deep:!0,immediate:!0}),e({addInteraction:he,removeInteraction:ue}),(Oe,$e)=>g.value&&Oe.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$a,[vue.createElementVNode("div",{class:"header"},[$e[1]||($e[1]=vue.createElementVNode("div",{class:"title"},"测量",-1)),vue.createElementVNode("i",{onClick:Ie,class:"map-iconfont icon-close"})]),vue.createElementVNode("div",_hoisted_2$6,[$e[2]||($e[2]=vue.createElementVNode("div",{class:"tips"},"在地图上点击多个点测量距离,距离单位",-1)),vue.createVNode(vue.unref(ElSelect),{class:"select-length-unit",modelValue:y.value,"onUpdate:modelValue":$e[0]||($e[0]=qe=>y.value=qe)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{label:"m",value:"1"}),vue.createVNode(vue.unref(ElOption),{label:"km",value:"2"}),vue.createVNode(vue.unref(ElOption),{label:"nm",value:"3"})]),_:1},8,["modelValue"])]),vue.createElementVNode("div",_hoisted_3$6,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.value,(qe,Pt)=>(vue.openBlock(),vue.createElementBlock("div",{class:"measure-history-item",key:Pt},[vue.createElementVNode("div",_hoisted_4$2,[$e[3]||($e[3]=vue.createElementVNode("i",{class:"map-iconfont icon-line"},null,-1)),vue.createElementVNode("span",_hoisted_5$2,"线段"+vue.toDisplayString(Pt+1),1),vue.createElementVNode("span",_hoisted_6$2,vue.toDisplayString(qe),1)]),vue.createElementVNode("div",{class:"delete-button",onClick:Lt=>xe(Pt)},$e[4]||($e[4]=[vue.createElementVNode("i",{class:"map-iconfont icon-delete"},null,-1)]),8,_hoisted_7$2)]))),128))])])):vue.createCommentVNode("",!0)}}),Measure=_export_sfc(_sfc_main$c,[["__scopeId","data-v-b36b46d6"]]),mapInstance$8=vue.ref(),renderMarkerSetInstance=t=>mapInstance$8.value=t,markerPosition=vue.ref(""),marker=vue.ref(),createIconStyle=t=>new Style({image:new Icon({src:CDN_URL+"map/poi-marker-default.png",anchor:[.5,1]}),text:new Text({text:t,offsetY:-90,font:"12px",fill:new Fill({color:"#000"}),stroke:new Stroke({color:"#fff",width:2}),backgroundFill:new Fill({color:"#fff"}),backgroundStroke:new Stroke({color:"#000",width:1}),padding:[2,2,2,2]})}),renderMarker=(t,e=!0,n=!0)=>{var V;if(!mapInstance$8.value||!t||t.split(",").length!==2)return;const[r,i]=t.split(",").map(Number);marker.value=new Feature({geometry:new Point(fromLonLat([r,i]))});const g=n?`${r}, ${i}`:"";(V=marker.value)==null||V.setStyle(createIconStyle(g));const y=new VectorSource({features:[marker.value]}),k=new VectorLayer({source:y}),L=mapInstance$8.value.getView();if(mapInstance$8.value.addLayer(k),e){const z=new Translate({layers:[k]});z.on("translating",function(j){var ie;const oe=j.features.item(0).getGeometry().getCoordinates(),re=toLonLat(oe);markerPosition.value=`${re[0].toFixed(6)}, ${re[1].toFixed(6)}`,(ie=marker.value)==null||ie.setStyle(createIconStyle(markerPosition.value))}),mapInstance$8.value.addInteraction(z)}const $=new Point([r,i]);L.setCenter(transform($.getCoordinates(),projection.data,projection.mercator)),L.setZoom(mapZoom.findShip)},setMarkerPosition=t=>{var i,g;if(!mapInstance$8.value)return;const e=mapInstance$8.value.getView(),n=t.split(",").map(Number);(g=(i=marker.value)==null?void 0:i.getGeometry())==null||g.setCoordinates(fromLonLat([n[0],n[1]]));const r=new Point([n[0],n[1]]);e.setCenter(transform(r.getCoordinates(),projection.data,projection.mercator)),e.setZoom(mapZoom.markerPosition)},CDN_URL="https://static.zhihaoscm.cn/",tiandituKey="a6e8f78974f2581f2ca00485b40c948f",zhongkeKey="15c81cc0a191a232e0a0ca1a51c3ca81",baseMap={tiandituTile:`https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituTileMark:`https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTile:`https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,tiandituImgTileMark:`https://t0.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&TILEMATRIXSET=w&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tiandituKey}`,greenTile:`${CDN_URL}/map/tile/{z}/{x}/{y}.png`},mapZoom={default:6,min:3,max:18,findShipMin:10,findShip:13,findTruck:14,shipGreenDotMax:11,truckDefault:14,truckStatistics:8,shipModelMin:13,shipModelMax:18,markerPosition:14},renderShipsLimit=200,mapDefaultCenter=[114.84,30.52],projection={data:"EPSG:4326",mercator:"EPSG:3857"},LOG_DATE_FORMAT="YYYY-MM-DD HH:mm:ss",DEFAULT_VALUE="--";vue.ref();const shipsLayer=vue.ref(),largeAmountShipsLayer=vue.ref(),selectShipsLayer=vue.ref(),allShips=vue.ref([]),selectSingleShipData=vue.ref();vue.ref();const trucksLayer=vue.ref(),shipTrackLineFeatures=vue.ref([]),trackLineVectorSource=vue.ref(),shipTrackVectorLayer=vue.ref();vue.ref(),vue.ref();const shipLabels=vue.ref([]),trackLabels=vue.ref([]),showTrackLayer=vue.ref(!1),allTracks=vue.ref([]),currentTrackId=vue.ref(""),showTrackAnimatMarker=vue.ref(!1),hiddenOrther=vue.ref(!1);function getIconFont(unicode=""){return unicode.indexOf("&amp;")!==-1&&(unicode=unicode.replace("&amp;","&")),unicode.indexOf("&amp")!==-1&&(unicode=unicode.replace("&amp","&")),eval('("'+unicode.replace("&#x","\\u").replace(";","")+'")')}const multiplyPixelRatio=t=>{const e=window.devicePixelRatio||1;return t.map(n=>n.map(r=>r*e))},adjustBounds=(t,e)=>e.length===2?[t[0]-e[0],t[1]-e[1],t[2]+e[0],t[3]+e[1]]:[t[0]+e[0],t[1]+e[1],t[2]+e[2],t[3]+e[3]],isOverlapping=(t,e)=>t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1],getIconStyle=t=>new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:"#fff"}),offsetY:-14}),zIndex:100}),getRotation=(t,e,n)=>{function r(z){return 180*(z%(2*Math.PI))/Math.PI}function i(z){return z%360*Math.PI/180}function g(z){if(!z)throw new Error("Coordinate is required");if(!Array.isArray(z)){if(z.type==="Feature"&&z.geometry!==null&&z.geometry.type==="Point")return z.geometry.coordinates;if(z.type==="Point")return z.coordinates}if(Array.isArray(z)&&z.length>=2&&!Array.isArray(z[0])&&!Array.isArray(z[1]))return z;throw new Error("Coordinate must be GeoJSON Point or an Array of numbers")}function y(z,j,oe={}){if(oe.final)return function(Ce,_e){return(y(_e,Ce)+180)%360}(z,j);const re=g(z),ie=g(j),ae=i(re[0]),le=i(ie[0]),de=i(re[1]),pe=i(ie[1]),ue=Math.sin(le-ae)*Math.cos(pe),he=Math.cos(de)*Math.sin(pe)-Math.sin(de)*Math.cos(pe)*Math.cos(le-ae);return r(Math.atan2(ue,he))}function k(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}function L(z,j={},oe={}){return z||console.log("Coordinates are required"),Array.isArray(z)||console.log("Coordinates must be an Array"),z.length<2&&console.log("Coordinates must be at least 2 numbers long"),(!k(z[0])||!k(z[1]))&&console.log("Coordinates must contain numbers"),$({type:"Point",coordinates:z},j,oe)}function $(z,j={},oe={}){const re={type:"Feature"};return oe.id!==void 0&&(re.id=oe.id),oe.bbox&&(re.bbox=oe.bbox),re.properties=j||{},re.geometry=z,re}const V=y(L(t),L(e),n);return V<0?360+V:V},labelAlpha=.8,labelFont="500 12px Arial",labelOutSize=2,labelHeight=10,fillRectRadius=(t,e,n,r,i,g,y=4)=>{t.beginPath(),t.moveTo(e+y,n),t.arcTo(e+r,n,e+r,n+y,y),t.arcTo(e+r,n+i,e+r-y,n+i,y),t.arcTo(e,n+i,e,n+i-y,y),t.arcTo(e,n,e+y,n,y),t.closePath(),t.fillStyle=g,t.fill()},getPixelFromCoordinate=t=>{if(!t||t.length===0)throw new Error("Points array is empty or invalid.");let e=1/0,n=1/0,r=-1/0,i=-1/0;for(const[g,y]of t)g<e&&(e=g),y<n&&(n=y),g>r&&(r=g),y>i&&(i=y);return[e,n,r,i]},calculatePolygonCentroid=t=>{if(!Array.isArray(t)||t.length<3)throw new Error("A polygon must have at least 3 coordinates.");let e=0,n=0,r=0;const i=t.length;for(let k=0;k<i-1;k++){const[L,$]=t[k],[V,z]=t[k+1],j=L*z-V*$;r+=j,e+=(L+V)*j,n+=($+z)*j}if(r*=.5,r===0)throw new Error("多边形面积为零");const g=e/(6*r),y=n/(6*r);return[g,y]},rotateShapeModel=(t,e)=>{const[n,r]=calculatePolygonCentroid(t),i=e*Math.PI/180,g=Math.cos(i),y=Math.sin(i);return t.map(([k,L])=>{const $=k-n,V=L-r,z=$*g-V*y+n,j=$*y+V*g+r;return[z,j]})},getTopLeftPoint=t=>[t[0],t[3]],getBottomLeftPoint=t=>[t[2],t[3]],getBottomRightPoint=t=>[t[2],t[1]],getTopRighttPoint=t=>[t[0],t[1]];function calculateBounds(t,e,n,r,i){let g,y,k,L;const $=t[0],V=t[1];switch(e){case 0:g=$+i,y=g+n,L=V-i,k=L-r;break;case 1:g=$+i,y=g+n,L=V+r/2,k=L-r;break;case 2:g=$+i,y=g+n,L=V+i+r,k=L-r;break;case 3:g=$-n/2,y=g+n,L=V+i+r,k=L-r;break;case 4:y=$,g=y-n,L=V+i+r,k=L-r;break;case 5:y=$-i,g=y-n,L=V+r/2,k=L-r;break;case 6:y=$,g=y-n,L=V-i,k=L-r;break;case 7:g=$-n/2,y=g+n,L=V-i,k=L-r}if(!(!g||!k||!y||!L))return[Math.min(g,y),Math.min(k,L),Math.max(g,y),Math.max(k,L)+1]}function calculateAnchorPoint(t,e,n=70,r=20,i=20){const g=[0,0];switch(e){case 0:g[0]=t[0]+i,g[1]=t[1]-i-r/2;break;case 1:g[0]=t[0]+i,g[1]=t[1];break;case 2:g[0]=t[0]+i,g[1]=t[1]+i+r/2;break;case 3:g[0]=t[0],g[1]=t[1]+i+r/4;break;case 4:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]+i+r/4;break;case 5:g[0]=t[0]-i,g[1]=t[1];break;case 6:g[0]=Math.max(t[0]-i,t[0]-n/2),g[1]=t[1]-i-r/4;break;case 7:g[0]=t[0],g[1]=t[1]-i-r/4}return g}function drawLabelBody(t,e,n){if(!t)return;const{font:r,labelOutSize:i=2,labelHeight:g,center:y,text:k,leftIcon:L,shipColor:$,lineLength:V=20,selected:z}=n;t.save(),r&&(t.font=r);let j=t.measureText(k).width+2*i;(L||$)&&(j+=g+4*i),t.restore();let oe;const re=20;let ie=-1;const ae=g+3*i;if(V)for(let le=0;le<8;le++){oe=calculateBounds(y,le,j,ae,V);let de=!1;for(let pe=0;pe<e.length;++pe){const ue=e[pe].bounds,he=[ue[0]-re,ue[1]-re,ue[2]+re,ue[3]+re];if(oe&&isOverlapping(oe,he)){de=!0;break}}if(!de){ie=le;break}}else ie=0,oe=calculateBounds(y,ie,j,ae,V);if(z&&ie===-1&&(ie=0),oe&&ie>-1){const le=getBottomLeftPoint(oe),de=getTopRighttPoint(oe);return{center:y,x:calculateAnchorPoint(y,ie,j,ae,V),l:de,r:le,bounds:oe,position:ie,name:k}}else return null}const drawText=(t,e)=>{if(!t)return;const{center:n,text:r,textColor:i,leftIcon:g,rightIcons:y,font:k}=e;t.save(),t.setTransform(1,0,0,1,0,0);let[L,$]=n;if(g){t.font="22px map-iconfont";const V=getIconFont(g.icon);t.fillStyle=g.color,t.fillText(V,L+labelOutSize-4,$+4),L+=22}if(y!=null&&y.length){t.font="12px map-iconfont",t.fillStyle="#3370ff";const V=t.measureText(r).width+6;y.forEach((z,j)=>{const oe=getIconFont(z),re=20*j;t.fillText(oe,L+V+re,$)})}t.font=k||labelFont,t.fillStyle=i,t.fillText(r,L,$),t.restore()},drawPolygon=(t,e)=>{let{points:n,strokeColor:r,fillColor:i,shouldClosePath:g,translation:y,rotation:k,rotationCenter:L,scale:$,globalAlpha:V}=e;if(V||(V=1),n&&t){t.save(),t.beginPath(),k&&k!==0&&L==null&&t.rotate(k),y&&t.translate(y[0],y[1]),k&&(L!=null&&L.length)&&t.rotate(k),$&&t.scale($,$),t.moveTo(n[0][0],n[0][1]);for(let z=1;z<n.length;z++)t.lineTo(n[z][0],n[z][1]);g&&t.closePath(),r&&(t.strokeStyle=r,t.stroke()),i&&g&&(V&&(t.globalAlpha=V),t.fillStyle=i,t.fill()),t.restore()}},intervalId=[],drawLabel=(t,e,n)=>{var z,j;let{center:r,text:i,color:g,textColor:y,bgColor:k,leftIcon:L,rightIcons:$,type:V}=e;if(r&&i){const oe={font:labelFont,labelOutSize,labelHeight,center:r,text:i,leftIcon:L,selected:e.selected};(z=e.blinkColors)!=null&&z.length&&(k=e.fill,y=getForegroundColor(e.fill));const re=drawLabelBody(t,n,oe);if(re){const{x:ie,bounds:ae,l:le}=re,de=[getTopLeftPoint(ae),getBottomLeftPoint(ae),getBottomRightPoint(ae),getTopRighttPoint(ae)];n.find(xe=>xe.name===i)||n.push(re),drawPolygon(t,{points:[r,ie],strokeColor:g,fillColor:"#000",shouldClosePath:!0,translation:void 0,rotation:void 0,rotationCenter:void 0,scale:void 0,globalAlpha:labelAlpha}),$!=null&&$.length&&$.forEach(()=>{de[1][0]+=20,de[2][0]+=20});const ue={points:de,strokeColor:g,fillColor:k,shouldClosePath:!0},[he,Ce]=le,_e={center:[he,Ce+labelOutSize+labelHeight+1],text:i,textColor:y,leftIcon:L,rightIcons:$,blinkColors:e.blinkColors};if(drawPolygon(t,ue),drawText(t,_e),((j=e==null?void 0:e.blinkColors)==null?void 0:j.length)>0){let xe=Date.now(),Ie=0;const Oe=[];e.blinkColors.forEach($e=>{Oe.push($e),Oe.push("white")}),intervalId[e.id]&&clearInterval(intervalId[e.id]),intervalId[e.id]=setInterval(()=>{const $e=Date.now();$e-xe>=500&&(Ie=(Ie+1)%Oe.length,xe=$e,ue.fillColor=Oe[Ie],drawPolygon(t,ue),_e.textColor=getForegroundColor(ue.fillColor),drawText(t,_e))},10)}else shipLabels.value.find(Ie=>Ie.name===i)&&(clearInterval(intervalId[e.id]),drawPolygon(t,ue),drawText(t,_e))}}return null},PI=Math.PI,a=6378245,ee=.006693421622965943;function transformLat(t,e){let n=-100+2*t+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(e*PI)+40*Math.sin(e/3*PI))*2/3,n+=(160*Math.sin(e/12*PI)+320*Math.sin(e*PI/30))*2/3,n}function transformLng(t,e){let n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=(20*Math.sin(6*t*PI)+20*Math.sin(2*t*PI))*2/3,n+=(20*Math.sin(t*PI)+40*Math.sin(t/3*PI))*2/3,n+=(150*Math.sin(t/12*PI)+300*Math.sin(t/30*PI))*2/3,n}function outOfChina(t,e){return!(t>73.66&&t<135.05&&e>3.86&&e<53.55)}function gcj02ToWgs84(t){const[e,n]=t.split(",").map(Number);if(outOfChina(e,n))return`${e.toFixed(6)}, ${n.toFixed(6)}`;{let r=transformLat(e-105,n-35),i=transformLng(e-105,n-35);const g=n/180*PI;let y=Math.sin(g);y=1-ee*y*y;const k=Math.sqrt(y);r=r*180/(a*(1-ee)/(y*k)*PI),i=i*180/(a/k*Math.cos(g)*PI);const L=n+r,$=e+i;return`${(e*2-$).toFixed(6)}, ${(n*2-L).toFixed(6)}`}}function calculateCirclePoints(t,e){const n=fromLonLat(t),r=e*1e3,i=[n[0]-r,n[1]-r,n[0]+r,n[1]+r],g=transformExtent(i,projection.mercator,projection.data);return{leftTopPoint:{lng:g[0],lat:g[3]},rightTopPoint:{lng:g[2],lat:g[3]},rightBottomPoint:{lng:g[2],lat:g[1]},leftBottomPoint:{lng:g[0],lat:g[1]}}}const equatorialCircumference=2003750834e-2;function lonLatToMercator(t){const e=t[0]*equatorialCircumference/180;let n=Math.log(Math.tan((90+t[1])*Math.PI/360))/(Math.PI/180);return n=n*equatorialCircumference/180,[e,n]}function mercatorToLonLat(t,e="lonlat"){const n={lon:0,lat:0},r=t[0]/equatorialCircumference*180;let i=t[1]/equatorialCircumference*180;return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),n.lon=r,n.lat=i,e==="lonlat"?n:[r,i]}function calculateBoundingBox(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;t.forEach(ie=>{const[ae,le]=ie;e=Math.min(e,le),n=Math.max(n,le),r=Math.min(r,ae),i=Math.max(i,ae)});const g=i-r,y=n-e,k=Math.max(g,y),L=(r+i)/2,$=(e+n)/2,V=k/2,z=L-V,j=L+V,oe=$-V,re=$+V;return[j,oe,z,re]}const transformUtils={gcj02ToWgs84,calculateCirclePoints,lonLatToMercator,mercatorToLonLat,calculateBoundingBox};class FeatureFormat{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Feature,this.supportedMediaTypes=null}getReadOptions(e,n){if(n){let r=n.dataProjection?get$1(n.dataProjection):this.readProjection(e);n.extent&&r&&r.getUnits()==="tile-pixels"&&(r=get$1(r),r.setWorldExtent(n.extent)),n={dataProjection:r,featureProjection:n.featureProjection}}return this.adaptOptions(n)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return abstract()}readFeature(e,n){return abstract()}readFeatures(e,n){return abstract()}readGeometry(e,n){return abstract()}readProjection(e){return abstract()}writeFeature(e,n){return abstract()}writeFeatures(e,n){return abstract()}writeGeometry(e,n){return abstract()}}function transformGeometryWithOptions(t,e,n){const r=n?get$1(n.featureProjection):null,i=n?get$1(n.dataProjection):null;let g=t;if(r&&i&&!equivalent(r,i)){e&&(g=t.clone());const y=e?r:i,k=e?i:r;y.getUnits()==="tile-pixels"?g.transform(y,k):g.applyTransform(getTransform(y,k))}if(e&&n&&n.decimals!==void 0){const y=Math.pow(10,n.decimals),k=function(L){for(let $=0,V=L.length;$<V;++$)L[$]=Math.round(L[$]*y)/y;return L};g===t&&(g=t.clone()),g.applyTransform(k)}return g}const GeometryConstructor={Point,LineString,Polygon,MultiPoint,MultiLineString,MultiPolygon};function orientFlatCoordinates(t,e,n){return Array.isArray(e[0])?(linearRingssAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRingsArray(t,0,e,n)),t):(linearRingsAreOriented(t,0,e,n)||(t=t.slice(),orientLinearRings(t,0,e,n)),t)}function createRenderFeature(t,e){var g;const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(y=>createRenderFeature({...t,geometry:y})).flat();const r=n.type==="MultiPolygon"?"Polygon":n.type;if(r==="GeometryCollection"||r==="Circle")throw new Error("Unsupported geometry type: "+r);const i=n.layout.length;return transformGeometryWithOptions(new RenderFeature(r,r==="Polygon"?orientFlatCoordinates(n.flatCoordinates,n.ends,i):n.flatCoordinates,(g=n.ends)==null?void 0:g.flat(),i,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function createGeometry(t,e){if(!t)return null;if(Array.isArray(t)){const r=t.map(i=>createGeometry(i,e));return new GeometryCollection(r)}const n=GeometryConstructor[t.type];return transformGeometryWithOptions(new n(t.flatCoordinates,t.layout,t.ends),!1,e)}class JSONFeature extends FeatureFormat{constructor(){super()}getType(){return"json"}readFeature(e,n){return this.readFeatureFromObject(getObject(e),this.getReadOptions(e,n))}readFeatures(e,n){return this.readFeaturesFromObject(getObject(e),this.getReadOptions(e,n))}readFeatureFromObject(e,n){return abstract()}readFeaturesFromObject(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromObject(getObject(e),this.getReadOptions(e,n))}readGeometryFromObject(e,n){return abstract()}readProjection(e){return this.readProjectionFromObject(getObject(e))}readProjectionFromObject(e){return abstract()}writeFeature(e,n){return JSON.stringify(this.writeFeatureObject(e,n))}writeFeatureObject(e,n){return abstract()}writeFeatures(e,n){return JSON.stringify(this.writeFeaturesObject(e,n))}writeFeaturesObject(e,n){return abstract()}writeGeometry(e,n){return JSON.stringify(this.writeGeometryObject(e,n))}writeGeometryObject(e,n){return abstract()}}function getObject(t){if(typeof t=="string"){const e=JSON.parse(t);return e||null}return t!==null?t:null}class GeoJSON extends JSONFeature{constructor(e){e=e||{},super(),this.dataProjection=get$1(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=get$1(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,n){let r=null;e.type==="Feature"?r=e:r={type:"Feature",geometry:e,properties:null};const i=readGeometryInternal(r.geometry);if(this.featureClass===RenderFeature)return createRenderFeature({geometry:i,id:r.id,properties:r.properties},n);const g=new Feature;return this.geometryName_?g.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&g.setGeometryName(r.geometry_name),g.setGeometry(createGeometry(i,n)),"id"in r&&g.setId(r.id),r.properties&&g.setProperties(r.properties,!0),g}readFeaturesFromObject(e,n){const r=e;let i=null;if(r.type==="FeatureCollection"){const g=e;i=[];const y=g.features;for(let k=0,L=y.length;k<L;++k){const $=this.readFeatureFromObject(y[k],n);$&&i.push($)}}else i=[this.readFeatureFromObject(e,n)];return i.flat()}readGeometryFromObject(e,n){return readGeometry(e,n)}readProjectionFromObject(e){const n=e.crs;let r;if(n)if(n.type=="name")r=get$1(n.properties.name);else if(n.type==="EPSG")r=get$1("EPSG:"+n.properties.code);else throw new Error("Unknown SRS type");else r=this.dataProjection;return r}writeFeatureObject(e,n){n=this.adaptOptions(n);const r={type:"Feature",geometry:null,properties:null},i=e.getId();if(i!==void 0&&(r.id=i),!e.hasProperties())return r;const g=e.getProperties(),y=e.getGeometry();return y&&(r.geometry=writeGeometry(y,n),delete g[e.getGeometryName()]),isEmpty$1(g)||(r.properties=g),r}writeFeaturesObject(e,n){n=this.adaptOptions(n);const r=[];for(let i=0,g=e.length;i<g;++i)r.push(this.writeFeatureObject(e[i],n));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,n){return writeGeometry(e,this.adaptOptions(n))}}function readGeometryInternal(t,e){if(!t)return null;let n;switch(t.type){case"Point":{n=readPointGeometry(t);break}case"LineString":{n=readLineStringGeometry(t);break}case"Polygon":{n=readPolygonGeometry(t);break}case"MultiPoint":{n=readMultiPointGeometry(t);break}case"MultiLineString":{n=readMultiLineStringGeometry(t);break}case"MultiPolygon":{n=readMultiPolygonGeometry(t);break}case"GeometryCollection":{n=readGeometryCollectionGeometry(t);break}default:throw new Error("Unsupported GeoJSON type: "+t.type)}return n}function readGeometry(t,e){const n=readGeometryInternal(t);return createGeometry(n,e)}function readGeometryCollectionGeometry(t,e){return t.geometries.map(function(r){return readGeometryInternal(r)})}function readPointGeometry(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:getLayoutForStride(e.length)}}function readLineStringGeometry(t){var r;const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:getLayoutForStride(((r=e[0])==null?void 0:r.length)||2)}}function readMultiLineStringGeometry(t){var g,y;const e=t.coordinates,n=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length)||2,r=[],i=deflateCoordinatesArray(r,0,e,n);return{type:"MultiLineString",flatCoordinates:r,ends:i,layout:getLayoutForStride(n)}}function readMultiPointGeometry(t){var n;const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:getLayoutForStride(((n=e[0])==null?void 0:n.length)||2)}}function readMultiPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=((y=(g=e[0])==null?void 0:g[0])==null?void 0:y[0].length)||2,i=deflateMultiCoordinatesArray(n,0,e,r);return{type:"MultiPolygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function readPolygonGeometry(t){var g,y;const e=t.coordinates,n=[],r=(y=(g=e[0])==null?void 0:g[0])==null?void 0:y.length,i=deflateCoordinatesArray(n,0,e,r);return{type:"Polygon",flatCoordinates:n,ends:i,layout:getLayoutForStride(r)}}function writeGeometry(t,e){t=transformGeometryWithOptions(t,!0,e);const n=t.getType();let r;switch(n){case"Point":{r=writePointGeometry(t);break}case"LineString":{r=writeLineStringGeometry(t);break}case"Polygon":{r=writePolygonGeometry(t,e);break}case"MultiPoint":{r=writeMultiPointGeometry(t);break}case"MultiLineString":{r=writeMultiLineStringGeometry(t);break}case"MultiPolygon":{r=writeMultiPolygonGeometry(t,e);break}case"GeometryCollection":{r=writeGeometryCollectionGeometry(t,e);break}case"Circle":{r={type:"GeometryCollection",geometries:[]};break}default:throw new Error("Unsupported geometry type: "+n)}return r}function writeGeometryCollectionGeometry(t,e){return e=Object.assign({},e),delete e.featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(r){return writeGeometry(r,e)})}}function writeLineStringGeometry(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}function writeMultiLineStringGeometry(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}function writeMultiPointGeometry(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}function writeMultiPolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}function writePointGeometry(t,e){return{type:"Point",coordinates:t.getCoordinates()}}function writePolygonGeometry(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}class TextFeature extends FeatureFormat{constructor(){super()}getType(){return"text"}readFeature(e,n){return this.readFeatureFromText(getText(e),this.adaptOptions(n))}readFeatureFromText(e,n){return abstract()}readFeatures(e,n){return this.readFeaturesFromText(getText(e),this.adaptOptions(n))}readFeaturesFromText(e,n){return abstract()}readGeometry(e,n){return this.readGeometryFromText(getText(e),this.adaptOptions(n))}readGeometryFromText(e,n){return abstract()}readProjection(e){return this.readProjectionFromText(getText(e))}readProjectionFromText(e){return this.dataProjection}writeFeature(e,n){return this.writeFeatureText(e,this.adaptOptions(n))}writeFeatureText(e,n){return abstract()}writeFeatures(e,n){return this.writeFeaturesText(e,this.adaptOptions(n))}writeFeaturesText(e,n){return abstract()}writeGeometry(e,n){return this.writeGeometryText(e,this.adaptOptions(n))}writeGeometryText(e,n){return abstract()}}function getText(t){return typeof t=="string"?t:""}function flipXY(t,e,n,r,i,g){i!==void 0?(i=i,g=g!==void 0?g:0):(i=[],g=0);let y=e;for(;y<n;){const k=t[y++];i[g++]=t[y++],i[g++]=k;for(let L=2;L<r;++L)i[g++]=t[y++]}return i.length=g,i}class Polyline extends TextFeature{constructor(e){super(),e=e||{},this.dataProjection=get$1("EPSG:4326"),this.factor_=e.factor?e.factor:1e5,this.geometryLayout_=e.geometryLayout?e.geometryLayout:"XY"}readFeatureFromText(e,n){const r=this.readGeometryFromText(e,n);return new Feature(r)}readFeaturesFromText(e,n){return[this.readFeatureFromText(e,n)]}readGeometryFromText(e,n){const r=getStrideForLayout(this.geometryLayout_),i=decodeDeltas(e,r,this.factor_);flipXY(i,0,i.length,r,i);const g=inflateCoordinates(i,0,i.length,r),y=new LineString(g,this.geometryLayout_);return transformGeometryWithOptions(y,!1,this.adaptOptions(n))}writeFeatureText(e,n){const r=e.getGeometry();if(r)return this.writeGeometryText(r,n);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(e,n){return this.writeFeatureText(e[0],n)}writeGeometryText(e,n){e=transformGeometryWithOptions(e,!0,this.adaptOptions(n));const r=e.getFlatCoordinates(),i=e.getStride();return flipXY(r,0,r.length,i,r),encodeDeltas(r,i,this.factor_)}}function encodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;for(let g=0,y=t.length;g<y;)for(r=0;r<e;++r,++g){const k=t[g],L=k-i[r];i[r]=k,t[g]=L}return encodeFloats(t,n)}function decodeDeltas(t,e,n){n=n||1e5;let r;const i=new Array(e);for(r=0;r<e;++r)i[r]=0;const g=decodeFloats(t,n);for(let y=0,k=g.length;y<k;)for(r=0;r<e;++r,++y)i[r]+=g[y],g[y]=i[r];return g}function encodeFloats(t,e){e=e||1e5;for(let n=0,r=t.length;n<r;++n)t[n]=Math.round(t[n]*e);return encodeSignedIntegers(t)}function decodeFloats(t,e){e=e||1e5;const n=decodeSignedIntegers(t);for(let r=0,i=n.length;r<i;++r)n[r]/=e;return n}function encodeSignedIntegers(t){for(let e=0,n=t.length;e<n;++e){const r=t[e];t[e]=r<0?~(r<<1):r<<1}return encodeUnsignedIntegers(t)}function decodeSignedIntegers(t){const e=decodeUnsignedIntegers(t);for(let n=0,r=e.length;n<r;++n){const i=e[n];e[n]=i&1?~(i>>1):i>>1}return e}function encodeUnsignedIntegers(t){let e="";for(let n=0,r=t.length;n<r;++n)e+=encodeUnsignedInteger(t[n]);return e}function decodeUnsignedIntegers(t){const e=[];let n=0,r=0;for(let i=0,g=t.length;i<g;++i){const y=t.charCodeAt(i)-63;n|=(y&31)<<r,y<32?(e.push(n),n=0,r=0):r+=5}return e}function encodeUnsignedInteger(t){let e,n="";for(;t>=32;)e=(32|t&31)+63,n+=String.fromCharCode(e),t>>=5;return e=t+63,n+=String.fromCharCode(e),n}const mapInstance$7=vue.ref(),renderTrackStyleSetInstance=t=>mapInstance$7.value=t,stopIcon="&#xe6e2;",stopColor="#E31818",slowIcon="&#xe703;",slowColor="#1890FF",dropletsIcon="&#xe6d2",trackList$1=vue.ref([]),renderTrackLine=(t,e,n)=>{var g,y,k;const r=t[e];if(!r)return;allTracks.value[e]=r,trackList$1.value=[],trackList$1.value=r.map((L,$)=>(L.center=[L.lon,L.lat],L.centerPoint=transformUtils.lonLatToMercator(L.center),L.id=e,L.index=$,L.time=hooks(L.createdAt).format("YYYY-MM-DD HH:mm:ss"),L));const i=trackList$1.value.map(L=>L.centerPoint);if(i.length>=2){const L=new LineString(i),$=new Feature({geometry:L});$.setStyle(new Style({stroke:new Stroke({color:n,width:2})})),$.setId(e),$.set("type","line"),(y=(g=shipTrackVectorLayer.value)==null?void 0:g.getSource())==null||y.clear(),shipTrackLineFeatures.value=[];const V=shipTrackLineFeatures.value.findIndex(z=>z.getId()===e);V>=0?shipTrackLineFeatures.value[V]=$:shipTrackLineFeatures.value.push($),createAnimatedIconFeature(n,i),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value=new VectorLayer({source:trackLineVectorSource.value}),renderPoint(n),(k=mapInstance$7.value)==null||k.addLayer(shipTrackVectorLayer.value)}},handlePlay=(t,e)=>{const n=allTracks.value[String(t)];playAnimation(n.map(r=>[r.lon,r.lat]),e)},removeShipTrackLineFeatureByIndex=(t,e)=>{t>=0&&t<shipTrackLineFeatures.value.length&&(shipTrackLineFeatures.value.splice(t,1),delete allTracks.value[e]),trackLineVectorSource.value=new VectorSource({features:[...shipTrackLineFeatures.value]}),shipTrackVectorLayer.value&&shipTrackVectorLayer.value.setSource(trackLineVectorSource.value)},createAnimatedIconFeature=(t,e)=>{const n=new Feature({geometry:new Point(fromLonLat([e[0][0],e[0][1]]))}),r=new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:t})})});return n.setStyle(r),n},geoMarkerStyle=new Style({text:new Text({font:"700 20px map-iconfont",text:getIconFont("&#xe657;"),fill:new Fill({color:"#ff0000"}),rotation:0})});let polyline,linePath,startMarker,position,geoMarker,vectorLayer;const trackAnimating=vue.ref(!1);let distance=0,lastTime=Date.now(),moveFeatureHandler=null;const moveFeature=(t,e)=>{var z;const n=Number(50*e),r=t.frameState.time,i=r-lastTime;if(distance=(distance+n*i/1e6)%2,lastTime=r,distance>=1){stopAnimation();return}const g=linePath.getCoordinateAt(distance>1?2-distance:distance),y=linePath.getCoordinateAt(distance>1?distance-.01:distance),k=linePath.getCoordinateAt(distance>1?2-distance:distance+.01),$=getRotation(transformUtils.mercatorToLonLat(y,"array"),transformUtils.mercatorToLonLat(k,"array"))*Math.PI/180;geoMarkerStyle.getText().setRotation($),position.setCoordinates(g);const V=getVectorContext(t);V.context_.save(),V.setStyle(geoMarkerStyle),V.drawGeometry(position),V.context_.restore(),(z=mapInstance$7.value)==null||z.render()},startAnimation=()=>{trackAnimating.value=!0,showTrackAnimatMarker.value=!0,lastTime=Date.now(),distance=0,position=startMarker.getGeometry().clone(),vectorLayer.on("postrender",moveFeatureHandler),geoMarker.setGeometry(null)},stopAnimation=()=>{var t;trackAnimating.value&&(trackAnimating.value=!1,geoMarker.setGeometry(null),vectorLayer.un("postrender",moveFeatureHandler),(t=mapInstance$7.value)==null||t.removeLayer(vectorLayer),vectorLayer=null,geoMarker=null)},playAnimation=(t,e)=>{var n;trackAnimating.value&&stopAnimation(),polyline=new Polyline({factor:1e6}).writeGeometry(new LineString(t)),linePath=new Polyline({factor:1e6}).readGeometry(polyline,{dataProjection:projection.data,featureProjection:projection.mercator}),startMarker=new Feature({type:"icon",geometry:new Point(linePath.getFirstCoordinate())}),position=startMarker.getGeometry().clone(),geoMarker=new Feature({type:"geoMarker",style:geoMarkerStyle,geometry:position}),vectorLayer=new VectorLayer({source:new VectorSource({features:[geoMarker]})}),(n=mapInstance$7.value)==null||n.addLayer(vectorLayer),moveFeatureHandler=r=>moveFeature(r,e),startAnimation()},renderPoint=t=>{if(!mapInstance$7.value)return;const e=trackList$1.value||[];if(!(e&&e.length>1))return[];const n={16:24,17:15,default:4},r=[],i=e.length;for(let k=0;k<i;k++){e[k].index=k;const L=mapInstance$7.value.getPixelFromCoordinate(e[k].centerPoint);if(L){let $=L.concat(L);$=adjustBounds($,[20,20]);const V=mapInstance$7.value.getView().getZoom();if(!V)return;if(V>15){const j=n[V]||n.default;$=adjustBounds($,[j,j])}let z=!0;if(e[k].state!=="0"){for(let j=0;j<r.length;j++)if(isOverlapping($,r[j].bounds)){z=!1;break}}z&&(e[k].bounds=$,r.push(e[k]))}}const g=getIconStyle(stopIcon),y=getIconStyle(slowIcon);r.forEach((k,L)=>{var z,j;const $=new Feature({geometry:new Point(k.centerPoint)});$.set("type","track_point"),$.set("data",k),$.setStyle([new Style({image:new CircleStyle({stroke:new Stroke({color:"rgba(0, 0, 0, 0.01)",width:20}),radius:3})}),new Style({image:new CircleStyle({fill:new Fill({color:t}),stroke:new Stroke({color:"#fff",width:2}),radius:3})})]),trackLineVectorSource.value.addFeature($);const V=new Feature({geometry:new Point(fromLonLat(k.center))});if(V.set("type","track_label"),V.set("track_label_index",L),V.setStyle(setTrackLabelStyle(k,t)),trackLineVectorSource.value.addFeature(V),typeof k=="object"&&k.hasOwnProperty("state")){const oe=new Feature({geometry:new Point(k.centerPoint)});oe.set("type","track_icon");const re=new Style({text:new Text({font:"Normal 22px map-iconfont",text:getIconFont(dropletsIcon),offsetY:-10}),zIndex:99}),ie=[];Number(k.state)===0?((z=re.getText())==null||z.setFill(new Fill({color:stopColor})),ie.push(g)):Number(k.state)===1&&((j=re.getText())==null||j.setFill(new Fill({color:slowColor})),ie.push(y)),ie.push(re),oe.setStyle(ie),trackLineVectorSource.value.addFeature(oe)}}),renderArrow(r,t),renderIconPoint()},renderArrow=(t,e)=>{const n=t.length;n||(t.push(trackList$1.value[0]),t.push(trackList$1.value[trackList$1.value.length-1]));for(let r=0;r<n-1;r++){let i;const g=t[r],y=(t[r+1].index+g.index)/2;if(y%2===0)i=trackList$1.value[y].centerPoint;else{const k=trackList$1.value[Math.floor(y)],L=trackList$1.value[Math.ceil(y)];if(k&&L){const[$,V]=k.centerPoint,[z,j]=L.centerPoint;i=[($+z)/2,(V+j)/2]}}if(i){const k=new Feature({geometry:new Point(i)});k.set("type","track_arrow"),k.setStyle(new Style({text:new Text({font:"700 14px map-iconfont",text:getIconFont("&#xe6bc;"),fill:new Fill({color:e}),rotation:getRotation(t[r].center,t[r+1].center)*(Math.PI/180)})})),trackLineVectorSource.value.addFeature(k)}}},renderIconPoint=()=>{const t="&#xe69b;",e="#fcdc3f",n="#ff0000";(trackList$1.value.length<2?[trackList$1.value[0]]:[trackList$1.value[0],trackList$1.value[trackList$1.value.length-1]]).forEach(i=>{const g=new Feature({geometry:new Point(i.centerPoint)});g.set("type","track_begin"),g.set("data",i);const y=i.index===0&&trackList$1.value.length>=2?e:n;g.setStyle(new Style({text:new Text({font:"Normal 14px map-iconfont",text:getIconFont(t),fill:new Fill({color:y})}),zIndex:101})),trackLineVectorSource.value.addFeature(g)})},setTrackLabelStyle=(t,e)=>new Style({renderer:(n,r)=>{const i=r.context,k={center:n,text:t.time,color:e,textColor:"#000",bgColor:"rgba(255,255,255,.8)",selected:!0,type:"TrackTime"};drawLabel(i,k,trackLabels.value)}}),triangleModel=multiplyPixelRatio([[0,-8],[5,8],[-5,8]]),shipShapeModel=multiplyPixelRatio([[0,-4.545],[-.56,-3.909],[-1,-2.727],[-1,3.636],[-.8,4.545],[.8,4.545],[1,3.636],[1,-2.727],[.56,-3.909],[0,-4.545]]),shipDirectPath={left:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},right:{0:[[0,0],[0,-8],[-4,-8]],1:[[0,0],[0,-16],[-6,-16]],2:[[0,0],[0,-24],[-8,-24]]},front:{0:[[0,0],[0,-8]],1:[[0,0],[0,-16]],2:[[0,0],[0,-24]]}},setBlankStyle=()=>new Style({image:new CircleStyle({radius:0})}),mapInstance$6=vue.ref(),renderShipStyleSetInstance=t=>mapInstance$6.value=t,speedCondition=[[1,10],[10,20],[20,1/0]],drawShipModelByZoom={14:[200,30],15:[115,15],16:[55,8],17:[25,5],18:[1,1]},setShipStyle=t=>new Style({renderer:(e,n)=>{const r=n.context,i=n.feature.get("data"),g=i.length/2;r.beginPath(),r.arc(e[0],e[1],g,0,2*Math.PI),r.fillStyle="rgba(0, 0, 0, 0.01)",r.fill(),n.feature.get("index")===0&&(shipLabels.value=[]);try{const k=drawShipBody(r,i,e);k&&(drawHeading(r,i,k),t&&(drawSelectBounds(r,k),i.selected=!0)),drawShipLabel(r,i,e)}catch{return!1}}}),drawShipBody=(t,e,n)=>{if(!mapInstance$6.value)return;const r=Math.round(Number(mapInstance$6.value.getView().getZoom()));if(!r)return;let i=[];const[g,y]=drawShipModelByZoom[r]||[0,0],[k,L]=n;if(r<=mapZoom.shipModelMax&&r>mapZoom.shipModelMin&&e.length>=g&&e.breadth>=y)i=rotateShapeModel(drawCurrentShipShapeModel(e,r),e.angle).map(V=>{const[z,j]=V;return[k+z,L+j]});else{const $=rotateShapeModel(triangleModel,e.angle);n.length===2&&(i=$.map(V=>{const[z,j]=V;return[k+z,L+j]}))}if(!(i.length>2))return!1;t.save(),t.beginPath(),t.moveTo(i[0][0],i[0][1]);for(let $=1;$<i.length;$++)t.lineTo(i[$][0],i[$][1]);return t.closePath(),t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.fillStyle=e.fill,t.fill(),t.restore(),i},drawHeading=(t,e,n)=>{const[r,i]=n[0],g=getShipDirectPath(e);if(g){const y=g.map(function(k){const[L,$]=k;return[L+r,$+i]});if(t.save(),t.beginPath(),e.angle>0){t.translate(r,i);const k=e.angle*Math.PI/180;t.rotate(k),t.translate(-r,-i)}t.moveTo(r,i);for(let k=1;k<y.length;k++){const[L,$]=y[k];t.lineTo(L,$)}t.strokeStyle="#000",t.lineWidth=1,t.stroke(),t.restore()}},drawSelectBounds=(t,e)=>{let[n,r,i,g]=getPixelFromCoordinate(e);const y=4;n-=y,r-=y,i+=y,g+=y,t.save(),t.strokeStyle="#ff0000",t.lineWidth=4;const k=8;t.beginPath(),t.moveTo(n+k,g),t.lineTo(n,g),t.lineTo(n,g-k),t.moveTo(n,r+k),t.lineTo(n,r),t.lineTo(n+k,r),t.moveTo(i-k,r),t.lineTo(i,r),t.lineTo(i,r+k),t.moveTo(i,g-k),t.lineTo(i,g),t.lineTo(i-k,g),t.stroke(),t.restore()},drawShipLabel=(t,e,n)=>{if(!e.selected&&shipLabels.value.find(z=>z.name===e.name))return;const[r,i]=n,g=r-0,y=i-0,k=e.name;let L;e.leftIconColor&&(L={color:e.leftIconColor,icon:"&#xe599;"});const $=getShipCustomIcon(e),V={id:e.id,center:[g,y],text:k,fill:e.fill,color:"#fff",textColor:"#000",bgColor:"#fff",leftIcon:L,rightIcons:$,selected:e.selected,blinkColors:e.blinkColors,type:"ShipName"};drawLabel(t,V,shipLabels.value)},drawCurrentShipShapeModel=(t,e)=>{let n=0;e<=14?n=.058:e===15?n=.12:e===16?n=.22:e===17?n=.435:e===18&&(n=.857);const r=t.length/4*n,i=t.breadth*n;let g=cloneDeep(shipShapeModel);return g=g.map(([y,k])=>[y*i,k*r]),g},getShipDirectPath=t=>{const{speed:e,hdg:n,cog:r}=t;let i="",g=null;if(e&&e>1&&(n!==null&&n!=511&&r!==null?r-n>=3?i="left":r-n<=-3?i="right":i="front":i="front",i&&e))for(const y in speedCondition){const k=speedCondition[y];if(e>=k[0]&&e<k[1]){g=shipDirectPath[i][y];break}}return g},getShipCustomIcon=t=>{const e=[];return t.existDevice&&e.push("&#xe687;"),t.existMobile&&e.push("&#xe688;"),t.existWaterGauge&&e.push("&#xe686;"),e||[]},TileEventType={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"},tmpTileCoord=[0,0,0],DECIMALS=5;class TileGrid{constructor(e){this.minZoom=e.minZoom!==void 0?e.minZoom:0,this.resolutions_=e.resolutions,assert(isSorted(this.resolutions_,(i,g)=>g-i),"`resolutions` must be sorted in descending order");let n;if(!e.origins){for(let i=0,g=this.resolutions_.length-1;i<g;++i)if(!n)n=this.resolutions_[i]/this.resolutions_[i+1];else if(this.resolutions_[i]/this.resolutions_[i+1]!==n){n=void 0;break}}this.zoomFactor_=n,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin!==void 0?e.origin:null,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,assert(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const r=e.extent;r!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=getTopLeft(r)),assert(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,assert(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize!==void 0?e.tileSize:this.tileSizes_?null:DEFAULT_TILE_SIZE,assert(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=r!==void 0?r:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes!==void 0?this.fullTileRanges_=e.sizes.map((i,g)=>{const y=new TileRange(Math.min(0,i[0]),Math.max(i[0]-1,-1),Math.min(0,i[1]),Math.max(i[1]-1,-1));if(r){const k=this.getTileRangeForExtentAndZ(r,g);y.minX=Math.max(k.minX,y.minX),y.maxX=Math.min(k.maxX,y.maxX),y.minY=Math.max(k.minY,y.minY),y.maxY=Math.min(k.maxY,y.maxY)}return y}):r&&this.calculateTileRanges_(r)}forEachTileCoord(e,n,r){const i=this.getTileRangeForExtentAndZ(e,n);for(let g=i.minX,y=i.maxX;g<=y;++g)for(let k=i.minY,L=i.maxY;k<=L;++k)r([n,g,k])}forEachTileCoordParentTileRange(e,n,r,i){let g,y,k,L=null,$=e[0]-1;for(this.zoomFactor_===2?(y=e[1],k=e[2]):L=this.getTileCoordExtent(e,i);$>=this.minZoom;){if(y!==void 0&&k!==void 0?(y=Math.floor(y/2),k=Math.floor(k/2),g=createOrUpdate(y,y,k,k,r)):g=this.getTileRangeForExtentAndZ(L,$,r),n($,g))return!0;--$}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,n,r){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){const g=e[1]*2,y=e[2]*2;return createOrUpdate(g,g+1,y,y+1,n)}const i=this.getTileCoordExtent(e,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,e[0]+1,n)}return null}getTileRangeForTileCoordAndZ(e,n,r){if(n>this.maxZoom||n<this.minZoom)return null;const i=e[0],g=e[1],y=e[2];if(n===i)return createOrUpdate(g,y,g,y,r);if(this.zoomFactor_){const L=Math.pow(this.zoomFactor_,n-i),$=Math.floor(g*L),V=Math.floor(y*L);if(n<i)return createOrUpdate($,$,V,V,r);const z=Math.floor(L*(g+1))-1,j=Math.floor(L*(y+1))-1;return createOrUpdate($,z,V,j,r)}const k=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(k,n,r)}getTileRangeForExtentAndZ(e,n,r){this.getTileCoordForXYAndZ_(e[0],e[3],n,!1,tmpTileCoord);const i=tmpTileCoord[1],g=tmpTileCoord[2];this.getTileCoordForXYAndZ_(e[2],e[1],n,!0,tmpTileCoord);const y=tmpTileCoord[1],k=tmpTileCoord[2];return createOrUpdate(i,y,g,k,r)}getTileCoordCenter(e){const n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=toSize(this.getTileSize(e[0]),this.tmpSize_);return[n[0]+(e[1]+.5)*i[0]*r,n[1]-(e[2]+.5)*i[1]*r]}getTileCoordExtent(e,n){const r=this.getOrigin(e[0]),i=this.getResolution(e[0]),g=toSize(this.getTileSize(e[0]),this.tmpSize_),y=r[0]+e[1]*g[0]*i,k=r[1]-(e[2]+1)*g[1]*i,L=y+g[0]*i,$=k+g[1]*i;return createOrUpdate$2(y,k,L,$,n)}getTileCoordForCoordAndResolution(e,n,r){return this.getTileCoordForXYAndResolution_(e[0],e[1],n,!1,r)}getTileCoordForXYAndResolution_(e,n,r,i,g){const y=this.getZForResolution(r),k=r/this.getResolution(y),L=this.getOrigin(y),$=toSize(this.getTileSize(y),this.tmpSize_);let V=k*(e-L[0])/r/$[0],z=k*(L[1]-n)/r/$[1];return i?(V=ceil(V,DECIMALS)-1,z=ceil(z,DECIMALS)-1):(V=floor(V,DECIMALS),z=floor(z,DECIMALS)),createOrUpdate$1(y,V,z,g)}getTileCoordForXYAndZ_(e,n,r,i,g){const y=this.getOrigin(r),k=this.getResolution(r),L=toSize(this.getTileSize(r),this.tmpSize_);let $=(e-y[0])/k/L[0],V=(y[1]-n)/k/L[1];return i?($=ceil($,DECIMALS)-1,V=ceil(V,DECIMALS)-1):($=floor($,DECIMALS),V=floor(V,DECIMALS)),createOrUpdate$1(r,$,V,g)}getTileCoordForCoordAndZ(e,n,r){return this.getTileCoordForXYAndZ_(e[0],e[1],n,!1,r)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,n){const r=linearFindNearest(this.resolutions_,e,n||0);return clamp(r,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,n){return intersectsLinearRing(n,0,n.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const n=this.resolutions_.length,r=new Array(n);for(let i=this.minZoom;i<n;++i)r[i]=this.getTileRangeForExtentAndZ(e,i);this.fullTileRanges_=r}}function getForProjection(t){let e=t.getDefaultTileGrid();return e||(e=createForProjection(t),t.setDefaultTileGrid(e)),e}function wrapX(t,e,n){const r=e[0],i=t.getTileCoordCenter(e),g=extentFromProjection(n);if(!containsCoordinate(g,i)){const y=getWidth(g),k=Math.ceil((g[0]-i[0])/y);return i[0]+=y*k,t.getTileCoordForCoordAndZ(i,r)}return e}function createForExtent(t,e,n,r){r=r!==void 0?r:"top-left";const i=resolutionsFromExtent(t,e,n);return new TileGrid({extent:t,origin:getCorner(t,r),resolutions:i,tileSize:n})}function createXYZ(t){const e=t||{},n=e.extent||get$1("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:resolutionsFromExtent(n,e.maxZoom,e.tileSize,e.maxResolution)};return new TileGrid(r)}function resolutionsFromExtent(t,e,n,r){e=e!==void 0?e:DEFAULT_MAX_ZOOM,n=toSize(n!==void 0?n:DEFAULT_TILE_SIZE);const i=getHeight(t),g=getWidth(t);r=r>0?r:Math.max(g/n[0],i/n[1]);const y=e+1,k=new Array(y);for(let L=0;L<y;++L)k[L]=r/Math.pow(2,L);return k}function createForProjection(t,e,n,r){const i=extentFromProjection(t);return createForExtent(i,e,n,r)}function extentFromProjection(t){t=get$1(t);let e=t.getExtent();if(!e){const n=180*METERS_PER_UNIT$1.degrees/t.getMetersPerUnit();e=createOrUpdate$2(-n,-n,n,n)}return e}class TileSource extends Source{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio!==void 0?e.tilePixelRatio:1,this.tileGrid=e.tileGrid!==void 0?e.tileGrid:null;const n=[256,256];this.tileGrid&&toSize(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),n),this.tmpSize=[0,0],this.key_=e.key||getUid(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){const n=e?this.getTileGridForProjection(e):this.tileGrid;return n?n.getResolutions():null}getTile(e,n,r,i,g){return abstract()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:getForProjection(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,n,r){const i=this.getTileGridForProjection(r),g=this.getTilePixelRatio(n),y=toSize(i.getTileSize(e),this.tmpSize);return g==1?y:scale$1(y,g,this.tmpSize)}getTileCoordForTileUrlFunction(e,n){const r=n!==void 0?n:this.getProjection(),i=n!==void 0?this.getTileGridForProjection(r):this.tileGrid||this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(e=wrapX(i,e,r)),withinExtentAndZ(e,i)?e:null}clear(){}refresh(){this.clear(),super.refresh()}}class TileSourceEvent extends BaseEvent{constructor(e,n){super(e),this.tile=n}}const zRegEx=/\{z\}/g,xRegEx=/\{x\}/g,yRegEx=/\{y\}/g,dashYRegEx=/\{-y\}/g;function renderXYZTemplate(t,e,n,r,i){return t.replace(zRegEx,e.toString()).replace(xRegEx,n.toString()).replace(yRegEx,r.toString()).replace(dashYRegEx,function(){if(i===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(i-r).toString()})}function expandUrl(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const r=n[1].charCodeAt(0),i=n[2].charCodeAt(0);let g;for(g=r;g<=i;++g)e.push(t.replace(n[0],String.fromCharCode(g)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)e.push(t.replace(n[0],i.toString()));return e}return e.push(t),e}function createFromTemplate(t,e){return function(n,r,i){if(!n)return;let g;const y=n[0];if(e){const k=e.getFullTileRange(y);k&&(g=k.getHeight()-1)}return renderXYZTemplate(t,y,n[1],n[2],g)}}function createFromTemplates(t,e){const n=t.length,r=new Array(n);for(let i=0;i<n;++i)r[i]=createFromTemplate(t[i],e);return createFromTileUrlFunctions(r)}function createFromTileUrlFunctions(t){return t.length===1?t[0]:function(e,n,r){if(!e)return;const i=hash(e),g=modulo(i,t.length);return t[g](e,n,r)}}class UrlTile extends TileSource{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===UrlTile.prototype.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,e.tileUrlFunction&&(this.tileUrlFunction=e.tileUrlFunction),this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){const n=e.target,r=getUid(n),i=n.getState();let g;i==TileState.LOADING?(this.tileLoadingKeys_[r]=!0,g=TileEventType.TILELOADSTART):r in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[r],g=i==TileState.ERROR?TileEventType.TILELOADERROR:i==TileState.LOADED?TileEventType.TILELOADEND:void 0),g!=null&&this.dispatchEvent(new TileSourceEvent(g,n))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,n){this.tileUrlFunction=e,typeof n<"u"?this.setKey(n):this.changed()}setUrl(e){const n=expandUrl(e);this.urls=n,this.setUrls(n)}setUrls(e){this.urls=e;const n=e.join(`
656
+ `);this.generateTileUrlFunction_?this.setTileUrlFunction(createFromTemplates(e,this.tileGrid),n):this.setKey(n)}tileUrlFunction(e,n,r){}}class TileImage extends UrlTile{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:defaultTileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate!==void 0?e.interpolate:!0,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin!==void 0?e.crossOrigin:null,this.tileClass=e.tileClass!==void 0?e.tileClass:ImageTile,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!equivalent(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=":disable-interpolation"),e}getTileGridForProjection(e){const n=this.getProjection();if(this.tileGrid&&(!n||equivalent(n,e)))return this.tileGrid;const r=getUid(e);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=getForProjection(e)),this.tileGridForProjection[r]}createTile_(e,n,r,i,g,y){const k=[e,n,r],L=this.getTileCoordForTileUrlFunction(k,g),$=L?this.tileUrlFunction(L,i,g):void 0,V=new this.tileClass(k,$!==void 0?TileState.IDLE:TileState.EMPTY,$!==void 0?$:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return V.key=y,V.addEventListener(EventType.CHANGE,this.handleTileChange.bind(this)),V}getTile(e,n,r,i,g){const y=this.getProjection();if(!y||!g||equivalent(y,g))return this.getTileInternal(e,n,r,i,y||g);const k=[e,n,r],L=this.getKey(),$=this.getTileGridForProjection(y),V=this.getTileGridForProjection(g),z=this.getTileCoordForTileUrlFunction(k,g),j=new ReprojTile(y,$,g,V,k,z,this.getTilePixelRatio(i),this.getGutter(),(oe,re,ie,ae)=>this.getTileInternal(oe,re,ie,ae,y),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return j.key=L,j}getTileInternal(e,n,r,i,g){const y=this.getKey();return this.createTile_(e,n,r,i,g,y)}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,n){const r=get$1(e);if(r){const i=getUid(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=n)}}}function defaultTileLoadFunction(t,e){t.getImage().src=e}class XYZ extends TileImage{constructor(e){e=e||{};const n=e.projection!==void 0?e.projection:"EPSG:3857",r=e.tileGrid!==void 0?e.tileGrid:createXYZ({extent:extentFromProjection(n),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize});super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:n,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX!==void 0?e.wrapX:!0,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter!==void 0?e.gutter:0}getGutter(){return this.gutter_}}const mapInstance$5=vue.ref(),renderShipSetInstance=t=>mapInstance$5.value=t;let shipsMarkerList=[],shipsVectorSource,largeAmountShipsSource;const selectedShipData=vue.ref(null);let selectShipsVectorSource;const renderShips=t=>{var n,r,i,g;if(!mapInstance$5.value||showTrackLayer.value)return;const e=Math.round(Number(mapInstance$5.value.getView().getZoom()));if(selectedShipData.value&&vue.nextTick(()=>{selectSingleShipMarker(selectedShipData.value)}).then(y=>{}),!(!e||e<mapZoom.shipGreenDotMax)&&(allShips.value=t,!hiddenOrther.value))return e>=mapZoom.shipGreenDotMax&&e<mapZoom.shipModelMin?((n=shipsLayer.value)==null||n.setVisible(!1),(r=largeAmountShipsLayer.value)==null||r.setVisible(!0),renderLargeAmountShips(t)):((i=largeAmountShipsLayer.value)==null||i.setVisible(!1),(g=shipsLayer.value)==null||g.setVisible(!0),renderShipsMarker(t))},renderLargeAmountShips=t=>{if(!mapInstance$5.value)return;const e=t.map(n=>({type:"Feature",geometry:{type:"Point",coordinates:[n.lon,n.lat]},properties:n}));return largeAmountShipsSource==null||largeAmountShipsSource.clear(),largeAmountShipsSource=new VectorSource({features:new GeoJSON().readFeatures({type:"FeatureCollection",features:e},{featureProjection:projection.mercator})}),largeAmountShipsLayer.value=new WebGLPointsLayer({source:largeAmountShipsSource,style:{"shape-points":3,"shape-radius":9,"shape-fill-color":["case",["==",["get","fill"],"#D9001C"],"#D9001C",["==",["get","fill"],"#04C900"],"#04C900","#04C900"],"shape-rotate-with-view":!1,"shape-rotation":["+",["get","cog"],180],"shape-scale":[.8,1.2],"shape-stroke-color":"#000000","shape-stroke-width":.5}}),mapInstance$5.value.addLayer(largeAmountShipsLayer.value),largeAmountShipsLayer.value},renderShipsMarker=t=>{var n;if(!mapInstance$5.value)return;deleteAllShipMarkers();let e=convertShipMapData(t);if(e=customFilterShips(e),!!(e!=null&&e.length))return e.forEach((r,i)=>{const g=[r.lon,r.lat],y=new Feature({geometry:new Point(fromLonLat(g))}),k=1;y.set("clickGeometry",new Circle(fromLonLat(g),k)),y.set("data",r),y.set("index",i),y.setStyle(setShipStyle(!1)),shipsMarkerList.push({ship:r,lonlat:g,feature:y})}),shipsVectorSource=new VectorSource({features:shipsMarkerList.map(r=>r.feature)}),shipsLayer.value=new VectorLayer({source:shipsVectorSource}),(n=mapInstance$5.value)==null||n.addLayer(shipsLayer.value),shipsLayer.value},customFilterShips=t=>{let e=cloneDeep(t);return e=e.filter(n=>{var i;const r=getFilterItem(n).every(({btnShow:g,value:y})=>g?!!y:!0);return(switchBtnShow.value.camera||switchBtnShow.value.mobile||switchBtnShow.value.waterGauge)&&((i=selectedShipData.value)==null?void 0:i.id)===n.id&&clearSelectFeature(),r}),e},getFilterItem=t=>[{btnShow:switchBtnShow.value.camera,value:t==null?void 0:t.existDevice},{btnShow:switchBtnShow.value.mobile,value:t==null?void 0:t.existMobile},{btnShow:switchBtnShow.value.waterGauge,value:t==null?void 0:t.existWaterGauge}],deleteAllShipMarkers=()=>{shipsMarkerList.forEach(t=>{t.feature&&(shipsVectorSource==null||shipsVectorSource.removeFeature(t.feature))}),shipsMarkerList=[]},selectSingleShipMarker=t=>{var g;if(!mapInstance$5.value)return;const e=cloneDeep(selectSingleShipData.value);selectSingleShipData.value=convertShipMapData(t);const n=[selectSingleShipData.value.lon,selectSingleShipData.value.lat],r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",selectSingleShipData.value),r.setStyle(setShipStyle(!0)),shipsMarkerList.push({ship:selectSingleShipData.value,lonlat:n,feature:r}),selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsVectorSource=new VectorSource({features:[r]}),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!0);const i=(g=shipsLayer.value)==null?void 0:g.getSource();return i&&(e&&setVisibleFeatureById(i,e.id,!0),setVisibleFeatureById(i,selectSingleShipData.value.id,!1)),mapInstance$5.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!0),selectShipsLayer.value},setVisibleFeatureById=(t,e,n)=>{t&&t.forEachFeature(r=>{const i=r.get("data");i&&i.id===e&&r.setStyle(n?setShipStyle(!1,i.id):setBlankStyle())})},findShip=(t,e,n=!0)=>{var i,g,y,k,L;if(!t||!mapInstance$5.value)return;const r=(y=(g=(i=shipsLayer.value)==null?void 0:i.getSource())==null?void 0:g.getFeatures())==null?void 0:y.find($=>{var V;return((V=$.get("data"))==null?void 0:V.id)===t});if(r?selectedShipData.value=r.get("data"):e&&(selectedShipData.value=e),!e){console.error("找不到船舶");return}if(n&&((k=selectedShipData.value)!=null&&k.lon)&&((L=selectedShipData.value)!=null&&L.lat)){const $=mapInstance$5.value.getView(),V=new Point([selectedShipData.value.lon,selectedShipData.value.lat]);$.setCenter(transform(V.getCoordinates(),projection.data,projection.mercator));const z=$.getZoom(),j=z<mapZoom.findShipMin?mapZoom.findShip:z;$.setZoom(j)}return selectSingleShipMarker(e),r},clearSelectFeature=()=>{var t;if(selectedShipData.value){setVisibleFeatureById(shipsVectorSource,selectSingleShipData.value.id,!1);const e=(t=shipsLayer.value)==null?void 0:t.getSource();e&&setVisibleFeatureById(e,selectSingleShipData.value.id,!0)}selectedShipData.value=null,mapInstance$5.value&&(selectShipsVectorSource==null||selectShipsVectorSource.clear(),selectShipsLayer.value=new VectorLayer({source:selectShipsVectorSource}),mapInstance$5.value.addLayer(selectShipsLayer.value),selectShipsLayer.value.setVisible(!1))},hiddenAllShips=()=>{var t,e;(t=shipsLayer.value)==null||t.setVisible(!1),(e=largeAmountShipsLayer.value)==null||e.setVisible(!1)},switchBtnShow=vue.ref({[SWITCH_BTN.Camera]:!1,[SWITCH_BTN.Mobile]:!1,[SWITCH_BTN.WaterGauge]:!1}),switchFilterItem=(t,e)=>{switchBtnShow.value[t]=e,renderShips(allShips.value)},rerenderShip=()=>{renderShips(allShips.value)},mapInstance$4=vue.ref(),renderCustomOverlaySetInstance=t=>mapInstance$4.value=t,drawCustomContent=(t,e,n,r="top-left",i=!1)=>{var V,z;if(!e||!mapInstance$4.value)return;document.querySelectorAll(".truck-custom-content").forEach(j=>j.parentNode.removeChild(j));const g=document.createElement("div");g.innerHTML=n;const y=new Overlay({element:g,position:e,positioning:r,stopEvent:i});if(i){let j=!1,oe=[0,0],re=[0,0];g.addEventListener("mousedown",function(ie){var ae;j=!0,ie.clientX,ie.clientY,oe=(ae=mapInstance$4.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-200,ie.clientY-200]),re=[ie.clientX-g.getBoundingClientRect().left+160,ie.clientY-g.getBoundingClientRect().top+84],ie.preventDefault()}),document.addEventListener("mousemove",function(ie){var ae;if(j){const le=(ae=mapInstance$4.value)==null?void 0:ae.getCoordinateFromPixel([ie.clientX-re[0],ie.clientY-re[1]]),de=le[0]-oe[0],pe=le[1]-oe[1];y.setPosition([oe[0]+de,oe[1]+pe])}}),document.addEventListener("mouseup",function(){j=!1})}(V=mapInstance$4.value)==null||V.addOverlay(y);const k=g.querySelector(".close-button");k&&k.addEventListener("click",()=>{var j,oe;(j=mapInstance$4.value)==null||j.removeOverlay(y),(oe=g.parentNode)==null||oe.removeChild(g)});const L=JSON.parse(JSON.stringify(e)),$=(z=mapInstance$4.value)==null?void 0:z.getCoordinateFromPixel(L);return y.setPosition($),y},mapInstance$3=vue.ref(),renderTrackSetInstance=t=>mapInstance$3.value=t,showTracks=vue.ref([]),trackList=vue.ref([]);vue.ref(null);const trackId=vue.ref(""),cursor=vue.ref(0),renderTrack=(t,e,n,r,i="ship")=>{var V;if(vue.nextTick(()=>{hiddenAllShips()}).then(z=>{}),(e==null?void 0:e.length)<2){((V=showTracks.value)==null?void 0:V.findIndex(z=>z.id===t))<0&&showTracks.value.push({id:t,length:""});return}const g={};e.forEach(z=>{z.state?z.state=Number(z.state):delete z.state}),trackId.value=t,g[t]=e,trackList.value=e;const y=["#ff0000","#00ff00","#0079ff","#ffa500","#800080","#008080","#ffc0cb","#800000","#000080","#808000"],k=g[t].map(z=>transform([z.lon,z.lat],projection.data,projection.mercator)),L=new LineString(k),$=formatUtils.formatLength(L,r)||"--";vue.nextTick(()=>{var j,oe;const z=(j=showTracks.value)==null?void 0:j.findIndex(re=>re.id===t);z<0?showTracks.value.push({id:t,length:$}):showTracks.value[z].length=$,++cursor.value,cursor.value>y.length&&(cursor.value=0),renderTrackLine(g,t,n),vue.nextTick(()=>{resetTrackView(t)}).then(()=>{}),(oe=mapInstance$3.value)==null||oe.on("moveend",()=>{showTrackLayer.value&&(trackLabels.value=[],renderTrackLine(g,t,n))}),renderTrackPointPopup()}).then(()=>{})},renderTrackPointPopup=()=>{var e;const t=vue.ref(null);(e=mapInstance$3.value)==null||e.on("pointermove",n=>{var i,g,y,k;t.value&&((i=mapInstance$3.value)==null||i.removeOverlay(t.value));const r=(g=mapInstance$3.value)==null?void 0:g.forEachFeatureAtPixel(n.pixel,L=>L);if(r){const L=r.get("data");if(!(L!=null&&L.time))return;let $="";L!=null&&L.stayTime&&($=`
657
657
  <div class="item w-100">
658
658
  <div class="item-label">停泊时间约</div>
659
659
  <div class="item-item">${L.stayTime}</div>
@@ -689,9 +689,9 @@ void main(void) {
689
689
  <div class="item-item">${L.time}</div>
690
690
  </div>
691
691
  ${$??$}
692
- </div>`,z=(y=mapInstance$3.value)==null?void 0:y.getPixelFromCoordinate(n.coordinate);t.value=drawCustomContent(L.time,z,V,"center-center")}else(k=mapInstance$3.value)==null||k.removeOverlay(t.value)})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$3.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},_hoisted_1$9={key:0,class:"more-tool-panel"},_hoisted_2$5={class:"switch-buttons"},_hoisted_3$5={class:"tool-components"},_sfc_main$b=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(ie=k.value)==null||ie.removeInteraction():(ae=k.value)==null||ae.addInteraction(),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n.value)==null||ie.on("moveend",()=>{var le,de;const ae=(de=(le=n.value)==null?void 0:le.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$5,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=le=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=le=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=le=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=le=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$5,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=le=>y.value=le),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$b,[["__scopeId","data-v-ef931f65"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,le;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=le;break}else if(oe>=k)break;ie=j,ae=oe,le=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$8={id:"scale-line-container"},_sfc_main$a=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;const g=new ScaleLine$1({units:i||"metric"}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8))}}),ScaleLine=_export_sfc(_sfc_main$a,[["__scopeId","data-v-46a928b4"]]),_hoisted_1$7={class:"zoom"},_sfc_main$9=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$9,[["__scopeId","data-v-602b1c0f"]]),_hoisted_1$6={class:"copyright"},_hoisted_2$4={class:"tdt-control-copyright tdt-control"},_hoisted_3$4=["src"],_sfc_main$8=vue.defineComponent({__name:"copyright",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",_hoisted_2$4,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+"map/tdt-logo.png",width:"53px",height:"22px",class:"logo",alt:""},null,8,_hoisted_3$4),n[0]||(n[0]=vue.createElementVNode("div",{class:"copyright-text"},"GS(2024)0568号 - 甲测资字1100471",-1))]),n[1]||(n[1]=vue.createElementVNode("div",{id:"dataSource",class:"tdt-control data-source"},"数据来源:自然资源部 & NavInfo",-1))]))}}),Copyright=_export_sfc(_sfc_main$8,[["__scopeId","data-v-9c5c2f7b"]]),dotImage$1=new Image;dotImage$1.src=`${CDN_URL}/map/truck-dot.svg`,dotImage$1.crossOrigin="anonymous";const dotActiveImage$1=new Image;dotActiveImage$1.src=`${CDN_URL}/map/truck-dot-active.svg`,dotActiveImage$1.crossOrigin="anonymous";const cameraImage=new Image;cameraImage.src=`${CDN_URL}/map/map-camera.svg`,cameraImage.crossOrigin="anonymous";const loadImage=new Image;loadImage.src=`${CDN_URL}/map/map-load.svg`,loadImage.crossOrigin="anonymous";const setTruckStyle=(t,e,n,r)=>new Style({renderer:(i,g)=>{const y=g.context;y.save();let k=1;y.scale(k,k);let[L,$]=i;L=L/k-20,$=$/k;const V=L-70,z=$-68;let j=180;const oe=56,re="#FFFFFF";let ie=176;const ae=52;let le="#164AFF",de="#FFFFFF";n===CAR_COLOR.YELLOW?(ie=176,le="#FFC81E",de="rgba(0,0,0,0.88)"):n===CAR_COLOR.Y_GREEN&&(j=200,ie=196,le="#8FED7C",de="rgba(0,0,0,0.88)"),r!=null&&r.length&&(j+=r.length*56),fillRectRadius(y,V,z,j,oe,re),fillRectRadius(y,V+2,z+2,ie,ae,le),n===CAR_COLOR.Y_GREEN&&fillRectRadius(y,V+2,z+2,68,ae,"#FFC81E"),y.save(),y.restore(),y.fillStyle=de,y.font="bold 28px Arial",y.textAlign="left",y.textBaseline="middle";const pe=`${e.slice(0,2)+" · "+e.slice(2)}`;if(y.fillText(pe,V+12,z+32),y.save(),y.restore(),r!=null&&r.length){const he=y.measureText(pe).width+12;let Ce=0;r.forEach(_e=>{_e===DEVICE_TYPE.CAMERA&&(y.drawImage(cameraImage,L-54+he+Ce*56,$-64,50,50),++Ce),_e===DEVICE_TYPE.LOAD&&(y.drawImage(loadImage,L-54+he+Ce*56,$-64,50,50),++Ce)})}const ue=dotImage$1;y.drawImage(ue,L+j/2-90,$,50/k,50/k),y.restore()}}),mapInstance$2=vue.ref(),renderDashboardSetInstance=t=>mapInstance$2.value=t;vue.ref([]);let truckMarkerList=[],trucksVectorSource;const renderTrucksMarker=t=>{if(deleteAllTruckMarkers(),!!mapInstance$2.value)return t.forEach(e=>{const n=formatUtils.convertSixHundredThousandToLatLng(e.lon,e.lat),r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",e),r.setStyle(setTruckStyle(!1,e.vno,e==null?void 0:e.vclColor,e==null?void 0:e.icons)),truckMarkerList.push({name:e.vno,lonlat:n,feature:r})}),trucksVectorSource=new VectorSource({features:truckMarkerList.map(e=>e.feature)}),trucksLayer.value=new VectorLayer({source:trucksVectorSource}),mapInstance$2.value.addLayer(trucksLayer.value),trucksLayer.value},deleteAllTruckMarkers=()=>{truckMarkerList.forEach(t=>{t.feature&&(trucksVectorSource==null||trucksVectorSource.removeFeature(t.feature))}),truckMarkerList=[]},mapInstance$1=vue.ref(),renderTruckSetInstance=t=>mapInstance$1.value=t,vehicle=vue.ref(null),focusShipData=vue.ref(),currentTruckOverlay=vue.ref(null),findTruck=async t=>{if(!mapInstance$1.value)return;focusShipData.value=t;const e=formatUtils.convertSixHundredThousandToLatLng(t.lon,t.lat),n=mapInstance$1.value.getPixelFromCoordinate(transform(e,projection.data,projection.mercator));currentTruckOverlay.value=drawTruckIcon(t.vno,n,t==null?void 0:t.drc);const r=mapInstance$1.value.getView(),i=new Point(e);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},clearAllTruck=()=>{vehicle.value.clearAllShip()},drawTruckIcon=(t,e,n)=>{const r=`<div id="${t}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${n}deg);">
692
+ </div>`,z=(y=mapInstance$3.value)==null?void 0:y.getPixelFromCoordinate(n.coordinate);t.value=drawCustomContent(L.time,z,V,"center-center")}else(k=mapInstance$3.value)==null||k.removeOverlay(t.value)})},removeAllTrackLayer=()=>{var t;showTracks.value=[],(t=trackLineVectorSource.value)==null||t.clear()},playTrack=(t,e)=>{handlePlay(String(t),e)},resetTrackView=t=>{var i;const e=mapInstance$3.value.getView(),n=t?shipTrackLineFeatures.value.find(g=>g.getId()===t):shipTrackLineFeatures.value[0];if(!n)return;const r=(i=n==null?void 0:n.getGeometry())==null?void 0:i.getExtent();if(r!=null&&r.length)try{const g=buffer(r,Math.max(r[2]-r[0],r[3]-r[1])*.02);e.fit(g)}catch(g){console.log(g)}},_hoisted_1$9={key:0,class:"more-tool-panel"},_hoisted_2$5={class:"switch-buttons"},_hoisted_3$5={class:"tool-components"},_sfc_main$b=vue.defineComponent({__name:"toolPanel",props:{vehicleMode:{},viewMode:{},disableGreenDot:{type:Boolean},showTrackLayer:{type:Boolean},mapTileMode:{}},emits:["switchGreenDot","switchMapTile"],setup(t,{emit:e}){var oe,re;const n=vue.inject("mapInstance"),r=t,i=e,g=vue.ref(((re=(oe=n.value)==null?void 0:oe.getView())==null?void 0:re.getZoom())||mapZoom.default),y=vue.ref(!1),k=vue.ref(null),L=vue.ref(!0),$=()=>{r.disableGreenDot||g.value>=mapZoom.shipGreenDotMax||(L.value=!L.value,i("switchGreenDot",L.value))},V=()=>{i("switchMapTile",r.mapTileMode===BaseMapType.vector?BaseMapType.satellite:BaseMapType.vector)},z=()=>{var ie,ae;y.value?(ie=k.value)==null||ie.removeInteraction():(ae=k.value)==null||ae.addInteraction(),y.value=!y.value},j=()=>{var ie;(ie=k.value)==null||ie.removeInteraction(),y.value=!1};return vue.onMounted(()=>{vue.nextTick(()=>{var ie;(ie=n.value)==null||ie.on("moveend",()=>{var le,de;const ae=(de=(le=n.value)==null?void 0:le.getView())==null?void 0:de.getZoom();ae&&(g.value=ae)})})}),(ie,ae)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createElementVNode("div",{class:vue.normalizeClass(`tool-panel ${ie.viewMode}`)},[ie.viewMode==="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$9,[vue.createElementVNode("div",_hoisted_2$5,[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[5]||(ae[5]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[6]||(ae[6]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[0]||(ae[0]=le=>V())},ae[7]||(ae[7]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"图层",-1)]),2)):vue.createCommentVNode("",!0),ie.vehicleMode==="truck"?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(`switch-btn ${ie.mapTileMode===vue.unref(BaseMapType).satellite&&"active"}`),onClick:ae[1]||(ae[1]=le=>V())},ae[8]||(ae[8]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)):vue.createCommentVNode("",!0),ie.showTrackLayer?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:4},[vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[2]||(ae[2]=le=>vue.unref(playTrack)(vue.unref(currentTrackId),1))},ae[9]||(ae[9]=[vue.createElementVNode("i",{class:"map-iconfont icon-play"},null,-1),vue.createElementVNode("div",{class:"button-text"},"播放轨迹",-1)])),vue.createElementVNode("div",{class:"switch-btn multiple",onClick:ae[3]||(ae[3]=le=>vue.unref(resetTrackView)())},ae[10]||(ae[10]=[vue.createElementVNode("i",{class:"map-iconfont icon-center"},null,-1),vue.createElementVNode("div",{class:"button-text"},"轨迹居中",-1)]))],64)):vue.createCommentVNode("",!0),vue.renderSlot(ie.$slots,"toolPanel",{},void 0,!0)])])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",`${y.value&&"active"}`]),onClick:z},ae[11]||(ae[11]=[vue.createElementVNode("i",{class:"map-iconfont icon-measure"},null,-1),vue.createElementVNode("div",{class:"button-text"},"测距",-1)]),2),ie.vehicleMode==="ship"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(`switch-btn ${L.value&&"active"} ${(ie.disableGreenDot||g.value>=vue.unref(mapZoom).shipGreenDotMax)&&"disabled"}`),onClick:$},ae[12]||(ae[12]=[vue.createElementVNode("i",{class:"map-iconfont icon-ship"},null,-1),vue.createElementVNode("div",{class:"button-text"},"绿点",-1)]),2)):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",{class:vue.normalizeClass(["switch-btn",{active:ie.mapTileMode===vue.unref(BaseMapType).satellite}]),onClick:V},ae[13]||(ae[13]=[vue.createElementVNode("i",{class:"map-iconfont icon-space"},null,-1),vue.createElementVNode("div",{class:"button-text"},"卫星",-1)]),2)],64))],2),vue.createElementVNode("div",_hoisted_3$5,[y.value?(vue.openBlock(),vue.createBlock(Measure,{key:0,ref_key:"measureRef",ref:k,visible:y.value,"onUpdate:visible":ae[4]||(ae[4]=le=>y.value=le),onClose:j,"view-mode":ie.viewMode},null,8,["visible","view-mode"])):vue.createCommentVNode("",!0)])],64))}}),ToolPanel=_export_sfc(_sfc_main$b,[["__scopeId","data-v-ef931f65"]]),UNITS_PROP="units",LEADING_DIGITS=[1,2,5],DEFAULT_DPI=25.4/.28;let ScaleLine$1=class extends Control{constructor(e){e=e||{};const n=document.createElement("div");n.style.pointerEvents="none",super({element:n,render:e.render,target:e.target}),this.on,this.once,this.un;const r=e.className!==void 0?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+CLASS_UNSELECTABLE,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth!==void 0?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(UNITS_PROP,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(UNITS_PROP)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(UNITS_PROP,e)}setDpi(e){this.dpi_=e}updateElement_(){const e=this.viewState_;if(!e){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const n=e.center,r=e.projection,i=this.getUnits(),g=i=="degrees"?"degrees":"m";let y=getPointResolution(r,e.resolution,n,g);const k=this.minWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI,L=this.maxWidth_!==void 0?this.maxWidth_*(this.dpi_||DEFAULT_DPI)/DEFAULT_DPI:void 0;let $=k*y,V="";if(i=="degrees"){const pe=METERS_PER_UNIT$1.degrees;$*=pe,$<pe/60?(V="″",y*=3600):$<pe?(V="′",y*=60):V="°"}else if(i=="imperial")$<.9144?(V="in",y/=.0254):$<1609.344?(V="ft",y/=.3048):(V="mi",y/=1609.344);else if(i=="nautical")y/=1852,V="NM";else if(i=="metric")$<1e-6?(V="nm",y*=1e9):$<.001?(V="μm",y*=1e6):$<1?(V="mm",y*=1e3):$<1e3?V="m":(V="km",y/=1e3);else if(i=="us")$<.9144?(V="in",y*=39.37):$<1609.344?(V="ft",y/=.30480061):(V="mi",y/=1609.3472);else throw new Error("Invalid units");let z=3*Math.floor(Math.log(k*y)/Math.log(10)),j,oe,re,ie,ae,le;for(;;){re=Math.floor(z/3);const pe=Math.pow(10,re);if(j=LEADING_DIGITS[(z%3+3)%3]*pe,oe=Math.round(j/y),isNaN(oe)){this.element.style.display="none",this.renderedVisible_=!1;return}if(L!==void 0&&oe>=L){j=ie,oe=ae,re=le;break}else if(oe>=k)break;ie=j,ae=oe,le=re,++z}const de=this.scaleBar_?this.createScaleBar(oe,j,V):j.toFixed(re<0?-re:0)+" "+V;this.renderedHTML_!=de&&(this.innerElement_.innerHTML=de,this.renderedHTML_=de),this.renderedWidth_!=oe&&(this.innerElement_.style.width=oe+"px",this.renderedWidth_=oe),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,n,r){const i=this.getScaleForResolution(),g=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),y=this.scaleBarSteps_,k=e/y,L=[this.createMarker("absolute")];for(let V=0;V<y;++V){const z=V%2===0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";L.push(`<div><div class="ol-scale-singlebar ${z}" style="width: ${k}px;"></div>`+this.createMarker("relative")+(V%2===0||y===2?this.createStepText(V,e,!1,n,r):"")+"</div>")}return L.push(this.createStepText(y,e,!0,n,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+g+"</div>":"")+L.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e==="absolute"?3:-10}px;"></div>`}createStepText(e,n,r,i,g){const k=(e===0?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(e===0?"":" "+g),L=e===0?-3:n/this.scaleBarSteps_*-1,$=e===0?0:n/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${L}px;text-align: ${e===0?"left":"center"};min-width: ${$}px;left: ${r?n+"px":"unset"};">`+k+"</div>"}getScaleForResolution(){const e=getPointResolution(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m"),n=this.dpi_||DEFAULT_DPI,r=1e3/25.4;return e*r*n}render(e){const n=e.frameState;n?this.viewState_=n.viewState:this.viewState_=null,this.updateElement_()}};const _hoisted_1$8={id:"scale-line-container"},_sfc_main$a=vue.defineComponent({__name:"scaleLine",setup(t,{expose:e}){const n=vue.inject("mapInstance");return e({setScaleLine:i=>{var k;const g=new ScaleLine$1({units:i||"metric"}),y=document.getElementById("scale-line-container");y&&(g.setTarget(y),(k=n.value)==null||k.addControl(g))}}),(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$8))}}),ScaleLine=_export_sfc(_sfc_main$a,[["__scopeId","data-v-8c27b246"]]),_hoisted_1$7={class:"zoom"},_sfc_main$9=vue.defineComponent({__name:"zoomControl",props:{map:{type:Object}},setup(t){const e=vue.inject("mapInstance"),n=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g+1)},r=()=>{if(!e.value)return;const i=e.value.getView(),g=i.getZoom();g&&i.setZoom(g-1)};return(i,g)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$7,[vue.createElementVNode("div",{onClick:n,class:"button big-button"},"+"),vue.createElementVNode("div",{onClick:r,class:"button small-button"},"-")]))}}),ZoomControl=_export_sfc(_sfc_main$9,[["__scopeId","data-v-f6b3b87d"]]),_hoisted_1$6={class:"copyright"},_hoisted_2$4={class:"tdt-control-copyright tdt-control"},_hoisted_3$4=["src"],_sfc_main$8=vue.defineComponent({__name:"copyright",setup(t){return(e,n)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[vue.createElementVNode("div",_hoisted_2$4,[vue.createElementVNode("img",{src:vue.unref(CDN_URL)+"map/tdt-logo.png",width:"53px",height:"22px",class:"logo",alt:""},null,8,_hoisted_3$4),n[0]||(n[0]=vue.createElementVNode("div",{class:"copyright-text"},"GS(2024)0568号 - 甲测资字1100471",-1))]),n[1]||(n[1]=vue.createElementVNode("div",{id:"dataSource",class:"tdt-control data-source"},"数据来源:自然资源部 & NavInfo",-1))]))}}),Copyright=_export_sfc(_sfc_main$8,[["__scopeId","data-v-9c5c2f7b"]]),dotImage$1=new Image;dotImage$1.src=`${CDN_URL}/map/truck-dot.svg`,dotImage$1.crossOrigin="anonymous";const dotActiveImage$1=new Image;dotActiveImage$1.src=`${CDN_URL}/map/truck-dot-active.svg`,dotActiveImage$1.crossOrigin="anonymous";const cameraImage=new Image;cameraImage.src=`${CDN_URL}/map/map-camera.svg`,cameraImage.crossOrigin="anonymous";const loadImage=new Image;loadImage.src=`${CDN_URL}/map/map-load.svg`,loadImage.crossOrigin="anonymous";const setTruckStyle=(t,e,n,r)=>new Style({renderer:(i,g)=>{const y=g.context;y.save();let k=1;y.scale(k,k);let[L,$]=i;L=L/k-20,$=$/k;const V=L-70,z=$-68;let j=180;const oe=56,re="#FFFFFF";let ie=176;const ae=52;let le="#164AFF",de="#FFFFFF";n===CAR_COLOR.YELLOW?(ie=176,le="#FFC81E",de="rgba(0,0,0,0.88)"):n===CAR_COLOR.Y_GREEN&&(j=200,ie=196,le="#8FED7C",de="rgba(0,0,0,0.88)"),r!=null&&r.length&&(j+=r.length*56),fillRectRadius(y,V,z,j,oe,re),fillRectRadius(y,V+2,z+2,ie,ae,le),n===CAR_COLOR.Y_GREEN&&fillRectRadius(y,V+2,z+2,68,ae,"#FFC81E"),y.save(),y.restore(),y.fillStyle=de,y.font="bold 28px Arial",y.textAlign="left",y.textBaseline="middle";const pe=`${e.slice(0,2)+" · "+e.slice(2)}`;if(y.fillText(pe,V+12,z+32),y.save(),y.restore(),r!=null&&r.length){const he=y.measureText(pe).width+12;let Ce=0;r.forEach(_e=>{_e===DEVICE_TYPE.CAMERA&&(y.drawImage(cameraImage,L-54+he+Ce*56,$-64,50,50),++Ce),_e===DEVICE_TYPE.LOAD&&(y.drawImage(loadImage,L-54+he+Ce*56,$-64,50,50),++Ce)})}const ue=dotImage$1;y.drawImage(ue,L+j/2-90,$,50/k,50/k),y.restore()}}),mapInstance$2=vue.ref(),renderDashboardSetInstance=t=>mapInstance$2.value=t;vue.ref([]);let truckMarkerList=[],trucksVectorSource;const renderTrucksMarker=t=>{if(deleteAllTruckMarkers(),!!mapInstance$2.value)return t.forEach(e=>{const n=formatUtils.convertSixHundredThousandToLatLng(e.lon,e.lat),r=new Feature({geometry:new Point(fromLonLat(n))});r.set("data",e),r.setStyle(setTruckStyle(!1,e.vno,e==null?void 0:e.vclColor,e==null?void 0:e.icons)),truckMarkerList.push({name:e.vno,lonlat:n,feature:r})}),trucksVectorSource=new VectorSource({features:truckMarkerList.map(e=>e.feature)}),trucksLayer.value=new VectorLayer({source:trucksVectorSource}),mapInstance$2.value.addLayer(trucksLayer.value),trucksLayer.value},deleteAllTruckMarkers=()=>{truckMarkerList.forEach(t=>{t.feature&&(trucksVectorSource==null||trucksVectorSource.removeFeature(t.feature))}),truckMarkerList=[]},mapInstance$1=vue.ref(),renderTruckSetInstance=t=>mapInstance$1.value=t,vehicle=vue.ref(null),focusShipData=vue.ref(),currentTruckOverlay=vue.ref(null),findTruck=async t=>{if(!mapInstance$1.value)return;focusShipData.value=t;const e=formatUtils.convertSixHundredThousandToLatLng(t.lon,t.lat),n=mapInstance$1.value.getPixelFromCoordinate(transform(e,projection.data,projection.mercator));currentTruckOverlay.value=drawTruckIcon(t.vno,n,t==null?void 0:t.drc);const r=mapInstance$1.value.getView(),i=new Point(e);r.setCenter(transform(i.getCoordinates(),projection.data,projection.mercator))},clearAllTruck=()=>{vehicle.value.clearAllShip()},drawTruckIcon=(t,e,n)=>{const r=`<div id="${t}" class="ol-custom-content truck-custom-content" style="width: 80px; height: 80px; transform: rotate(${n}deg);">
693
693
  <img src="${CDN_URL}map/car-icon.gif" width="100%" height="100%" />
694
- </div>`;return drawCustomContent(t,e,r,"center-center")},removeTruckIcon=()=>{var e;const t=(e=currentTruckOverlay.value)==null?void 0:e.getElement();t&&(t.innerHTML="")},zoomTruckIcon=()=>{var g;if(!mapInstance$1.value)return;const t=mapInstance$1.value.getView().getZoom(),e=120,n=60;function r(y){return y<14?n:y>=14&&y<=18?Math.round((y-14)*(e-n)/4+n):e}const i=r(t);(g=document.querySelectorAll(".truck-custom-content"))==null||g.forEach(y=>{y.style.width=`${i}px`,y.style.height=`${i}px`})},mapInstance=vue.ref(),drawPolygonSetInstance=t=>mapInstance.value=t;let layerState="drawn",drawnState="undrawn";const source=new VectorSource;let sketch,helpTooltipElement,helpTooltip,measureTooltipElement,measureTooltip,circleStyle,drawVector,draw;function createMeasureTooltip(){var t;measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(t=mapInstance.value)==null||t.addOverlay(measureTooltip)}function createHelpTooltip(){var t;helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),(t=mapInstance.value)==null||t.addOverlay(helpTooltip)}let squareLimitError=!1,lineLimitError=!1;const validateSquareLimit=t=>{let n=1/0,r=-1/0,i=1/0,g=-1/0;t==null||t.forEach(L=>{const $=transform(L,projection.mercator,projection.data),V=$[0],z=$[1];n=Math.min(n,z),r=Math.max(r,z),i=Math.min(i,V),g=Math.max(g,V)});const y=(r-n)*111,k=(g-i)*111;squareLimitError=y>150||k>150};let storeFeature;const addInteraction=t=>{var r,i;drawVector||init(),drawnState="undrawn",layerState="drawn",(r=mapInstance.value)==null||r.addLayer(drawVector);const e=new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})});draw=new Draw({type:"Polygon",source,trace:!0,style:[e,circleStyle]}),(i=mapInstance.value)==null||i.addInteraction(draw),createMeasureTooltip(),createHelpTooltip();let n;draw.on("drawstart",function(g){var y;layerState="drawn",sketch=g.feature,n=(y=sketch.getGeometry())==null?void 0:y.on("change",function(k){const L=k.target;let $=formatUtils.formatArea(L,LENGTH_UNIT.NM);const z=L.getCoordinates()[0],j=new LineString([z[z.length-2],z[z.length-1]]);let oe=formatUtils.formatLength(j,LENGTH_UNIT.NM);if(lineLimitError=Number(getLength(j)/1e3)>150,validateSquareLimit(z),measureTooltipElement&&$&&(measureTooltipElement.innerHTML=`
694
+ </div>`;return drawCustomContent(t,e,r,"center-center")},removeTruckIcon=()=>{var e;const t=(e=currentTruckOverlay.value)==null?void 0:e.getElement();t&&(t.innerHTML="")},zoomTruckIcon=()=>{var g;if(!mapInstance$1.value)return;const t=mapInstance$1.value.getView().getZoom(),e=120,n=60;function r(y){return y<14?n:y>=14&&y<=18?Math.round((y-14)*(e-n)/4+n):e}const i=r(t);(g=document.querySelectorAll(".truck-custom-content"))==null||g.forEach(y=>{y.style.width=`${i}px`,y.style.height=`${i}px`})},mapInstance=vue.ref(),drawPolygonSetInstance=t=>mapInstance.value=t;let layerState="drawn",drawnState="undrawn";const source=new VectorSource;let sketch,helpTooltipElement,helpTooltip,measureTooltipElement,measureTooltip,circleStyle,drawVector,draw;function createMeasureTooltip(){var t;measureTooltipElement!=null&&measureTooltipElement.parentNode&&measureTooltipElement.parentNode.removeChild(measureTooltipElement),measureTooltipElement=document.createElement("div"),measureTooltipElement.className="ol-tooltip ol-tooltip-draw-polygon",measureTooltip=new Overlay({element:measureTooltipElement,offset:[0,-15],positioning:"bottom-center",stopEvent:!1,insertFirst:!1}),(t=mapInstance.value)==null||t.addOverlay(measureTooltip)}function createHelpTooltip(){var t;helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),helpTooltipElement=document.createElement("div"),helpTooltipElement.className="ol-tooltip ol-help-tooltip hidden",helpTooltip=new Overlay({element:helpTooltipElement,offset:[15,0],positioning:"center-left"}),(t=mapInstance.value)==null||t.addOverlay(helpTooltip)}let squareLimitError=!1,lineLimitError=!1;const validateSquareLimit=t=>{let n=1/0,r=-1/0,i=1/0,g=-1/0;t==null||t.forEach(L=>{const $=transform(L,projection.mercator,projection.data),V=$[0],z=$[1];n=Math.min(n,z),r=Math.max(r,z),i=Math.min(i,V),g=Math.max(g,V)});const y=(r-n)*111,k=(g-i)*111;squareLimitError=y>150||k>150};let storeFeature;const addInteraction=t=>{var r,i;drawVector||init(),drawnState="undrawn",layerState="drawn",(r=mapInstance.value)==null||r.addLayer(drawVector);const e=new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:1.5,lineDash:[10,10]}),fill:new Fill({color:"rgba(255, 255, 255, 0.25)"})});draw=new Draw({type:"Polygon",source,trace:!0,style:[e,circleStyle]}),(i=mapInstance.value)==null||i.addInteraction(draw),createMeasureTooltip(),createHelpTooltip();let n;draw.on("drawstart",function(g){var y;layerState="drawn",sketch=g.feature,n=(y=sketch.getGeometry())==null?void 0:y.on("change",function(k){const L=k.target,$=formatUtils.formatArea(L,LENGTH_UNIT.NM),z=L.getCoordinates()[0],j=new LineString([z[z.length-2],z[z.length-1]]),oe=formatUtils.formatLength(j,LENGTH_UNIT.NM);if(lineLimitError=Number(getLength(j)/1e3)>150,validateSquareLimit(z),measureTooltipElement&&$&&(measureTooltipElement.innerHTML=`
695
695
  <span class="text">面积:${$}${lineLimitError||squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
696
696
  `),helpTooltipElement&&$){let re="";parseFloat($)>0&&(re=`
697
697
  <div class="text ${squareLimitError?"error":""}">面积:${$}${squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</div>`),helpTooltipElement.innerHTML=`${re}
@@ -699,9 +699,9 @@ void main(void) {
699
699
  <div><span class="text">单击继续,双击结束</span></div>
700
700
  `}}),drawnState="drawing"}),draw.on("drawend",function(g){var y;if(g.feature.getGeometry()){storeFeature=g.feature;const k=endFn(g.feature);k!=null&&k.length&&t&&t(k)}if(sketch=null,measureTooltipElement=null,createMeasureTooltip(),n&&unByKey(n),drawnState="drawend",draw){const k=mapInstance.value.getInteractions().getArray().find(L=>L.ol_uid===draw.ol_uid);k&&((y=mapInstance.value)==null||y.removeInteraction(k)),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}})},removeInteraction=()=>{var t,e,n;if(mapInstance.value){if(document.querySelectorAll(".ol-tooltip.ol-tooltip-draw-polygon").forEach(r=>{var i;(i=r==null?void 0:r.parentNode)==null||i.removeChild(r)}),source.clear(),(t=mapInstance.value)==null||t.removeLayer(drawVector),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement),((e=mapInstance.value)==null?void 0:e.getTargetElement()).style.cursor="",document.querySelector("#map").style.cursor="",draw){const r=mapInstance.value.getInteractions().getArray().find(i=>i.ol_uid===draw.ol_uid);r&&((n=mapInstance.value)==null||n.removeInteraction(r))}drawnState="undrawn",layerState="destroyed"}},endFn=t=>{var e,n,r;if(t.getGeometry()){const i=[],y=t.getGeometry().getCoordinates();(e=y[0])==null||e.forEach(L=>{i.push(transform(L,projection.mercator,projection.data))});const k=y[0][y[0].length-2];if(k&&measureTooltip.setPosition(k),measureTooltip.setOffset([10,0]),measureTooltipElement&&(measureTooltipElement.innerHTML+='<span class="delete-icon"><i class="map-iconfont icon-delete" /></div>'),(n=document.querySelector(".delete-icon"))==null||n.addEventListener("click",()=>{reset()}),!lineLimitError&&!squareLimitError)return i;draw&&((r=mapInstance.value)==null||r.removeInteraction(draw)),helpTooltipElement!=null&&helpTooltipElement.parentNode&&helpTooltipElement.parentNode.removeChild(helpTooltipElement)}},initFeature=t=>{var e,n;if(layerState="drawn",storeFeature){const r=storeFeature.getGeometry();if(!r)return;const i=formatUtils.formatArea(r,LENGTH_UNIT.NM);measureTooltipElement&&(measureTooltipElement.innerHTML=`
701
701
  <span class="text">面积:${i}${lineLimitError||squareLimitError?'<span class="error pl-12">超出可以绘画的距离</span>':""}</span>
702
- `),(e=drawVector.getSource())==null||e.addFeature(storeFeature);const g=endFn(storeFeature);g!=null&&g.length&&t&&t(g);const y=getCenter(storeFeature.getGeometry().getExtent());(n=mapInstance.value)==null||n.getView().setCenter(y)}},pointerMoveHandler=function(t){var n;if(t.dragging)return;let e="点击选择起点";sketch&&(e="单击继续,双击结束"),helpTooltipElement&&(helpTooltipElement.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement.classList.remove("hidden")),layerState==="drawn"&&(((n=mapInstance.value)==null?void 0:n.getTargetElement()).style.cursor="crosshair")},init=()=>{mapInstance.value&&(circleStyle=new Style({image:new CircleStyle({radius:5,fill:new Fill({color:"rgb(51,112,255, 1)"})}),geometry:function(t){const e=t.getGeometry().getCoordinates();return new MultiPoint(e)}}),drawVector=new VectorLayer({source,style:new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:2}),fill:new Fill({color:"rgba(255, 255, 255, 0.3)"})})}),mapInstance.value.on("pointermove",pointerMoveHandler),mapInstance.value.getViewport().addEventListener("mouseout",function(){var t;(t=helpTooltipElement==null?void 0:helpTooltipElement.classList)==null||t.add("hidden")}),mapInstance.value.on("dblclick",function(t){drawnState!=="undrawn"&&(t.stopPropagation(),t.preventDefault())}))},reset=()=>{removeInteraction(),addInteraction(),storeFeature=null},drawPolygonTool={addInteraction,removeInteraction,initFeature,reset},dotImage=new Image;dotImage.crossOrigin="anonymous";const dotActiveImage=new Image;dotActiveImage.crossOrigin="anonymous";const setPointStyle=(t,e,n)=>{const{color:r,url:i,activeUrl:g,activeColor:y}=n;return(g||i)&&(t?dotActiveImage.src=CDN_URL+(g||i):dotImage.src=CDN_URL+(i||g)),new Style({renderer:(k,L)=>{const $=L.context;$.save();let V=1;$.scale(V,V);let[z,j]=k;z=z/V,j=j/V,$.font="12px Arial";const oe=$.measureText(e).width,re=z-oe/2,ie=j-10,ae=oe+4,le=20,de=t&&y||r;if(fillRectRadius($,re,ie+30,ae,le,de),$.save(),$.restore(),$.fillStyle=t?"#FFFFFF":"#000000",$.textAlign="center",$.textBaseline="middle",$.fillText(e,re+(oe+4)/2,ie+41),$.save(),$.restore(),i||g){const pe=t?dotActiveImage:dotImage;$.drawImage(pe,z-pe.width/2,j-pe.height/2,40/V,40/V)}$.restore()}})};class PointMarkerClass{constructor(e,n){qn(this,"mapInstance");qn(this,"pointMarkerList",[]);qn(this,"pointsVectorSource");qn(this,"highlightPoint");qn(this,"pointLayer");qn(this,"options");this.mapInstance=e,this.options=n}renderPointMarker(e){if(this.deleteAllPointMarkers(),!this.mapInstance)return;let n={};e.forEach(r=>{var g;const i=[r.lon,r.lat];if(((g=this.highlightPoint)==null?void 0:g.id)===r.id)n={id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],pointType:r.pointType};else{const y=this.getFeature(r,i);this.pointMarkerList.push({id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],feature:y,pointType:r.pointType})}}),n&&n.lonlat&&(n.feature=this.getFeature(n,n.lonlat),this.pointMarkerList.push(n)),this.pointsVectorSource=new VectorSource({features:[...this.pointMarkerList.map(r=>r.feature)]}),this.pointLayer=new VectorLayer({source:this.pointsVectorSource}),this.mapInstance.addLayer(this.pointLayer),console.log(this.pointLayer)}deleteAllPointMarkers(e){this.pointMarkerList.forEach(n=>{var r;n.feature&&e!==n.id&&((r=this.pointsVectorSource)==null||r.removeFeature(n.feature))})}cancelHighlightTruckMarker(){if(!this.highlightPoint)return;const{id:e,name:n}=this.highlightPoint;this.highlightPoint=void 0,this.pointMarkerList.find(r=>{r.id===e&&r.feature.setStyle(setPointStyle(!1,n,this.options))})}highlightPointMarker(e){if(!this.mapInstance)return;const{id:n,name:r,fullName:i,lon:g,lat:y,pointType:k}=e,L=[Number(g),Number(y)];this.highlightPoint={id:n,name:r,fullName:i,lonlat:L,pointType:k},this.setPointCenter(L)}getFeature(e,n){var i;const r=new Feature({geometry:new Point(fromLonLat(n))});return r.set("data",e),r.setStyle(setPointStyle(((i=this.highlightPoint)==null?void 0:i.id)===e.id,e.name,this.options)),r}setPointCenter(e,n={customZoom:mapZoom.findShip,type:1}){if(!this.mapInstance)return;const{customZoom:r=mapZoom.findShip,type:i=1}=n,g=this.mapInstance.getView(),y=g.getZoom();(i===1||y>r&&i===2||y<r&&i===3)&&g.setZoom(r);const k=new Point(e);g.setCenter(transform(k.getCoordinates(),projection.data,projection.mercator))}}const _sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{},center:{},vehicleMode:{},viewMode:{},mmsi:{},shipData:{}},emits:["zoomChanged","extentChanged"],setup(t,{expose:e,emit:n}){const r=vue.ref();vue.provide("mapInstance",r);const i=vue.ref(null),g=vue.ref(null),y=vue.ref(null),k=n,L=t,$=vue.ref(L.zoom||mapZoom.default),V=vue.ref(!1),z=vue.ref(!0),j=vue.ref(!0);let oe;(_e=>{_e[_e.tiandituTile=new TileLayer({source:new XYZ({url:baseMap.tiandituTile})})]="tiandituTile",_e[_e.tiandituTileMark=new TileLayer({source:new XYZ({url:baseMap.tiandituTileMark})})]="tiandituTileMark",_e[_e.tiandituImgTile=new TileLayer({source:new XYZ({url:baseMap.tiandituImgTile}),visible:!1})]="tiandituImgTile",_e[_e.tiandituImgTileMark=new TileLayer({source:new XYZ({url:baseMap.tiandituImgTileMark}),visible:!1})]="tiandituImgTileMark",_e[_e.greenMark=new TileLayer({source:new XYZ({url:baseMap.greenTile})})]="greenMark"})(oe||(oe={}));const re=()=>{var xe,Ie;const _e={projection:projection.mercator,zoom:L.zoom||(L.vehicleMode==="ship"?mapZoom.default:mapZoom.truckDefault),minZoom:mapZoom.min,maxZoom:mapZoom.max,center:transformUtils.lonLatToMercator(L.center||mapDefaultCenter),constrainResolution:!0,enableRotation:!1,multiWorld:!0};r.value=new Map$2({target:"map",layers:[oe.tiandituTile,oe.tiandituTileMark,oe.tiandituImgTile,oe.tiandituImgTileMark,oe.greenMark],view:new View(_e)}),ie(),(xe=g.value)==null||xe.setScaleLine(L.vehicleMode==="ship"&&"nautical"),(Ie=r.value)==null||Ie.on("moveend",pe),ae(_e.zoom<mapZoom.shipGreenDotMax),de(L.vehicleMode==="ship"||L.viewMode==="findShip"?BaseMapType.satellite:BaseMapType.vector),L.viewMode==="findShip"&&L.mmsi&&L.shipData&&vue.nextTick(()=>{findShip(String(L.mmsi),L.shipData)})};vue.onMounted(()=>{re()});const ie=()=>{r.value&&(renderCustomOverlaySetInstance(r.value),renderTruckSetInstance(r.value),drawPolygonSetInstance(r.value),renderShipStyleSetInstance(r.value),renderTrackStyleSetInstance(r.value),renderDashboardSetInstance(r.value),renderMarkerSetInstance(r.value),renderShipSetInstance(r.value),renderTrackSetInstance(r.value))},ae=_e=>{var xe;L.vehicleMode!=="ship"&&(_e=!1),(xe=r.value)==null||xe.getLayers().forEach(Ie=>{Ie.ol_uid===oe.greenMark.ol_uid&&(Ie.setVisible(_e),z.value=_e)})},le=vue.ref(BaseMapType.satellite),de=_e=>{var xe;le.value=_e,(xe=r.value)==null||xe.getLayers().forEach(Ie=>{(Ie.ol_uid===oe.tiandituTile.ol_uid||Ie.ol_uid===oe.tiandituTileMark.ol_uid||Ie.ol_uid===oe.tiandituImgTile.ol_uid||Ie.ol_uid===oe.tiandituImgTileMark.ol_uid)&&Ie.setVisible(!1),(_e===BaseMapType.vector&&(Ie.ol_uid===oe.tiandituTile.ol_uid||Ie.ol_uid===oe.tiandituTileMark.ol_uid)||_e===BaseMapType.satellite&&(Ie.ol_uid===oe.tiandituImgTile.ol_uid||Ie.ol_uid===oe.tiandituImgTileMark.ol_uid))&&Ie.setVisible(!0)})},pe=()=>{const _e=r.value.getView(),xe=_e.getZoom();xe&&ue(xe);const Ie=_e.calculateExtent(r.value.getSize());Ie&&xe&&he(Ie,xe)},ue=_e=>{var Oe,$e,qe,Pt,Lt;$.value=_e,ae(_e<mapZoom.shipGreenDotMax);const xe=(Oe=r.value)==null?void 0:Oe.getLayers(),Ie=L.vehicleMode==="ship"?xe==null?void 0:xe.getArray().find(Ve=>Ve.ol_uid===oe.greenMark.ol_uid):void 0;showTrackLayer.value?(j.value=!1,Ie==null||Ie.setVisible(!1),($e=shipsLayer.value)==null||$e.setVisible(!1),(qe=largeAmountShipsLayer.value)==null||qe.setVisible(!1)):!V.value&&z.value&&_e<=mapZoom.shipGreenDotMax?(j.value=!0,Ie==null||Ie.setVisible(!0),(Pt=shipsLayer.value)==null||Pt.setVisible(!1),(Lt=largeAmountShipsLayer.value)==null||Lt.setVisible(!1)):(j.value=!1,Ie==null||Ie.setVisible(!1)),k("zoomChanged",_e)},he=(_e,xe)=>{const Ie=transform([_e[0],_e[1]],projection.mercator,projection.data),Oe=transform([_e[2],_e[3]],projection.mercator,projection.data);k("extentChanged",{extent:[Ie,Oe],zoom:xe})};return e({mapInstance:r,initMap:re,pointRender:(_e,xe)=>new PointMarkerClass(_e,xe),renderTrucksMarker,renderShip:renderShips,renderTrack:(_e,xe,Ie)=>{var Oe,$e;currentTrackId.value=_e,showTrackLayer.value=!0,V.value=!0,hiddenAllShips(),($e=(Oe=largeAmountShipsLayer.value)==null?void 0:Oe.getSource())==null||$e.clear(),renderTrack(_e,xe,Ie,LENGTH_UNIT.NM)},findTruck,removeTruckIcon,clearAllTruck,closeTrack:()=>{var _e,xe;showTrackLayer.value=!1,(_e=shipTrackVectorLayer.value)==null||_e.setVisible(!1),(xe=selectShipsLayer.value)==null||xe.setVisible(!0),V.value=!1,ae($.value<mapZoom.shipGreenDotMax),allTracks.value=[],stopAnimation()},closeTruckTrack:()=>{var _e,xe;showTrackLayer.value=!1,(_e=shipTrackVectorLayer.value)==null||_e.setVisible(!1),(xe=selectShipsLayer.value)==null||xe.setVisible(!0),stopAnimation()},resetTrackView,playTrack,clearSelectFeature,findShip,focusShip:(_e,xe,Ie=!0)=>{var Oe,$e;hiddenOrther.value=Ie,(Oe=shipsLayer.value)==null||Oe.setVisible(!Ie),($e=largeAmountShipsLayer.value)==null||$e.setVisible(!1),findShip(_e,xe)},showTracks,removeAllTrackLayer,switchFilterItem,rerenderShip,switchGreenDot:()=>ae(!1),zoomTruckIcon,renderTruckTrack:(_e,xe,Ie)=>{showTrackLayer.value=!0,renderTrack(_e,xe,Ie,LENGTH_UNIT.KM,"truck")},removerLayer:removeShipTrackLineFeatureByIndex,renderMarker,setMarkerPosition:_e=>{V.value=!0,setMarkerPosition(_e)},getZoomAndCenter:()=>{var $e;const _e=($e=r.value)==null?void 0:$e.getView();if(!_e)return null;const xe=Math.round(Number(_e.getZoom())),{lon:Ie,lat:Oe}=transformUtils.mercatorToLonLat(_e.getCenter());return{zoom:xe,center:[Ie,Oe]}},setCenter:_e=>{var Oe;const xe=(Oe=r.value)==null?void 0:Oe.getView();if(!xe)return null;const Ie=new Point(_e);xe.setCenter(transform(Ie.getCoordinates(),projection.data,projection.mercator))},drawPolygonTool,setMapInstance:ie,config:{mapZoom,projection},utils:{transform:transformUtils,format:formatUtils}}),(_e,xe)=>(vue.openBlock(),vue.createElementBlock("div",{class:"map-page map-container",ref_key:"pageRef",ref:i},[xe[0]||(xe[0]=vue.createElementVNode("div",{id:"map",class:"map"},null,-1)),vue.createVNode(ToolPanel,{"vehicle-mode":_e.vehicleMode,"view-mode":_e.viewMode,"disable-green-dot":V.value,"show-track-layer":vue.unref(showTrackLayer),"map-tile-mode":le.value,onSwitchGreenDot:ae,onSwitchMapTile:de},{toolPanel:vue.withCtx(()=>[vue.renderSlot(_e.$slots,"toolPanel",{},void 0,!0)]),_:3},8,["vehicle-mode","view-mode","disable-green-dot","show-track-layer","map-tile-mode"]),_e.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(ScaleLine,{ref_key:"scaleLineControl",ref:g},null,512),vue.createVNode(ZoomControl,{ref_key:"zoomControl",ref:y},null,512)],64)):vue.createCommentVNode("",!0),vue.createVNode(Copyright)],512))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-02481ec2"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
702
+ `),(e=drawVector.getSource())==null||e.addFeature(storeFeature);const g=endFn(storeFeature);g!=null&&g.length&&t&&t(g);const y=getCenter(storeFeature.getGeometry().getExtent());(n=mapInstance.value)==null||n.getView().setCenter(y)}},pointerMoveHandler=function(t){var n;if(t.dragging)return;let e="点击选择起点";sketch&&(e="单击继续,双击结束"),helpTooltipElement&&(helpTooltipElement.innerHTML=e,helpTooltip.setPosition(t.coordinate),helpTooltipElement.classList.remove("hidden")),layerState==="drawn"&&(((n=mapInstance.value)==null?void 0:n.getTargetElement()).style.cursor="crosshair")},init=()=>{mapInstance.value&&(circleStyle=new Style({image:new CircleStyle({radius:5,fill:new Fill({color:"rgb(51,112,255, 1)"})}),geometry:function(t){const e=t.getGeometry().getCoordinates();return new MultiPoint(e)}}),drawVector=new VectorLayer({source,style:new Style({stroke:new Stroke({color:"rgba(255, 255, 255, 1)",width:2}),fill:new Fill({color:"rgba(255, 255, 255, 0.3)"})})}),mapInstance.value.on("pointermove",pointerMoveHandler),mapInstance.value.getViewport().addEventListener("mouseout",function(){var t;(t=helpTooltipElement==null?void 0:helpTooltipElement.classList)==null||t.add("hidden")}),mapInstance.value.on("dblclick",function(t){drawnState!=="undrawn"&&(t.stopPropagation(),t.preventDefault())}))},reset=()=>{removeInteraction(),addInteraction(),storeFeature=null},drawPolygonTool={addInteraction,removeInteraction,initFeature,reset},dotImage=new Image;dotImage.crossOrigin="anonymous";const dotActiveImage=new Image;dotActiveImage.crossOrigin="anonymous";const setPointStyle=(t,e,n)=>{const{color:r,url:i,activeUrl:g,activeColor:y}=n;return(g||i)&&(t?dotActiveImage.src=CDN_URL+(g||i):dotImage.src=CDN_URL+(i||g)),new Style({renderer:(k,L)=>{const $=L.context;$.save();const V=1;$.scale(V,V);let[z,j]=k;z=z/V,j=j/V,$.font="12px Arial";const oe=$.measureText(e).width,re=z-oe/2,ie=j-10,ae=oe+4,le=20,de=t&&y||r;if(fillRectRadius($,re,ie+30,ae,le,de),$.save(),$.restore(),$.fillStyle=t?"#FFFFFF":"#000000",$.textAlign="center",$.textBaseline="middle",$.fillText(e,re+(oe+4)/2,ie+41),$.save(),$.restore(),i||g){const pe=t?dotActiveImage:dotImage;$.drawImage(pe,z-pe.width/2,j-pe.height/2,40/V,40/V)}$.restore()}})};class PointMarkerClass{constructor(e,n){qn(this,"mapInstance");qn(this,"pointMarkerList",[]);qn(this,"pointsVectorSource");qn(this,"highlightPoint");qn(this,"pointLayer");qn(this,"options");this.mapInstance=e,this.options=n}renderPointMarker(e){if(this.deleteAllPointMarkers(),!this.mapInstance)return;let n={};e.forEach(r=>{var g;const i=[r.lon,r.lat];if(((g=this.highlightPoint)==null?void 0:g.id)===r.id)n={id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],pointType:r.pointType};else{const y=this.getFeature(r,i);this.pointMarkerList.push({id:r.id,name:r.name,lonlat:[Number(r.lon),Number(r.lat)],feature:y,pointType:r.pointType})}}),n&&n.lonlat&&(n.feature=this.getFeature(n,n.lonlat),this.pointMarkerList.push(n)),this.pointsVectorSource=new VectorSource({features:[...this.pointMarkerList.map(r=>r.feature)]}),this.pointLayer=new VectorLayer({source:this.pointsVectorSource}),this.mapInstance.addLayer(this.pointLayer),console.log(this.pointLayer)}deleteAllPointMarkers(e){this.pointMarkerList.forEach(n=>{var r;n.feature&&e!==n.id&&((r=this.pointsVectorSource)==null||r.removeFeature(n.feature))})}cancelHighlightTruckMarker(){if(!this.highlightPoint)return;const{id:e,name:n}=this.highlightPoint;this.highlightPoint=void 0,this.pointMarkerList.find(r=>{r.id===e&&r.feature.setStyle(setPointStyle(!1,n,this.options))})}highlightPointMarker(e){if(!this.mapInstance)return;const{id:n,name:r,fullName:i,lon:g,lat:y,pointType:k}=e,L=[Number(g),Number(y)];this.highlightPoint={id:n,name:r,fullName:i,lonlat:L,pointType:k},this.setPointCenter(L)}getFeature(e,n){var i;const r=new Feature({geometry:new Point(fromLonLat(n))});return r.set("data",e),r.setStyle(setPointStyle(((i=this.highlightPoint)==null?void 0:i.id)===e.id,e.name,this.options)),r}setPointCenter(e,n={customZoom:mapZoom.findShip,type:1}){if(!this.mapInstance)return;const{customZoom:r=mapZoom.findShip,type:i=1}=n,g=this.mapInstance.getView(),y=g.getZoom();(i===1||y>r&&i===2||y<r&&i===3)&&g.setZoom(r);const k=new Point(e);g.setCenter(transform(k.getCoordinates(),projection.data,projection.mercator))}}const _sfc_main$7=vue.defineComponent({__name:"Map",props:{zoom:{},center:{},vehicleMode:{},viewMode:{},mmsi:{},shipData:{}},emits:["zoomChanged","extentChanged"],setup(t,{expose:e,emit:n}){const r=vue.ref();vue.provide("mapInstance",r);const i=vue.ref(null),g=vue.ref(null),y=vue.ref(null),k=n,L=t,$=vue.ref(L.zoom||mapZoom.default),V=vue.ref(!1),z=vue.ref(!0),j=vue.ref(!0);let oe;(_e=>{_e[_e.tiandituTile=new TileLayer({source:new XYZ({url:baseMap.tiandituTile})})]="tiandituTile",_e[_e.tiandituTileMark=new TileLayer({source:new XYZ({url:baseMap.tiandituTileMark})})]="tiandituTileMark",_e[_e.tiandituImgTile=new TileLayer({source:new XYZ({url:baseMap.tiandituImgTile}),visible:!1})]="tiandituImgTile",_e[_e.tiandituImgTileMark=new TileLayer({source:new XYZ({url:baseMap.tiandituImgTileMark}),visible:!1})]="tiandituImgTileMark",_e[_e.greenMark=new TileLayer({source:new XYZ({url:baseMap.greenTile})})]="greenMark"})(oe||(oe={}));const re=()=>{var xe,Ie;const _e={projection:projection.mercator,zoom:L.zoom||(L.vehicleMode==="ship"?mapZoom.default:mapZoom.truckDefault),minZoom:mapZoom.min,maxZoom:mapZoom.max,center:transformUtils.lonLatToMercator(L.center||mapDefaultCenter),constrainResolution:!0,enableRotation:!1,multiWorld:!0};r.value=new Map$2({target:"map",layers:[oe.tiandituTile,oe.tiandituTileMark,oe.tiandituImgTile,oe.tiandituImgTileMark,oe.greenMark],view:new View(_e)}),ie(),(xe=g.value)==null||xe.setScaleLine(L.vehicleMode==="ship"&&"nautical"),(Ie=r.value)==null||Ie.on("moveend",pe),ae(_e.zoom<mapZoom.shipGreenDotMax),de(L.vehicleMode==="ship"||L.viewMode==="findShip"?BaseMapType.satellite:BaseMapType.vector),L.viewMode==="findShip"&&L.mmsi&&L.shipData&&vue.nextTick(()=>{findShip(String(L.mmsi),L.shipData)})};vue.onMounted(()=>{re()});const ie=()=>{r.value&&(renderCustomOverlaySetInstance(r.value),renderTruckSetInstance(r.value),drawPolygonSetInstance(r.value),renderShipStyleSetInstance(r.value),renderTrackStyleSetInstance(r.value),renderDashboardSetInstance(r.value),renderMarkerSetInstance(r.value),renderShipSetInstance(r.value),renderTrackSetInstance(r.value))},ae=_e=>{var xe;L.vehicleMode!=="ship"&&(_e=!1),(xe=r.value)==null||xe.getLayers().forEach(Ie=>{Ie.ol_uid===oe.greenMark.ol_uid&&(Ie.setVisible(_e),z.value=_e)})},le=vue.ref(BaseMapType.satellite),de=_e=>{var xe;le.value=_e,(xe=r.value)==null||xe.getLayers().forEach(Ie=>{(Ie.ol_uid===oe.tiandituTile.ol_uid||Ie.ol_uid===oe.tiandituTileMark.ol_uid||Ie.ol_uid===oe.tiandituImgTile.ol_uid||Ie.ol_uid===oe.tiandituImgTileMark.ol_uid)&&Ie.setVisible(!1),(_e===BaseMapType.vector&&(Ie.ol_uid===oe.tiandituTile.ol_uid||Ie.ol_uid===oe.tiandituTileMark.ol_uid)||_e===BaseMapType.satellite&&(Ie.ol_uid===oe.tiandituImgTile.ol_uid||Ie.ol_uid===oe.tiandituImgTileMark.ol_uid))&&Ie.setVisible(!0)})},pe=()=>{const _e=r.value.getView(),xe=_e.getZoom();xe&&ue(xe);const Ie=_e.calculateExtent(r.value.getSize());Ie&&xe&&he(Ie,xe)},ue=_e=>{var Oe,$e,qe,Pt,Lt;$.value=_e,ae(_e<mapZoom.shipGreenDotMax);const xe=(Oe=r.value)==null?void 0:Oe.getLayers(),Ie=L.vehicleMode==="ship"?xe==null?void 0:xe.getArray().find(Ve=>Ve.ol_uid===oe.greenMark.ol_uid):void 0;showTrackLayer.value?(j.value=!1,Ie==null||Ie.setVisible(!1),($e=shipsLayer.value)==null||$e.setVisible(!1),(qe=largeAmountShipsLayer.value)==null||qe.setVisible(!1)):!V.value&&z.value&&_e<=mapZoom.shipGreenDotMax?(j.value=!0,Ie==null||Ie.setVisible(!0),(Pt=shipsLayer.value)==null||Pt.setVisible(!1),(Lt=largeAmountShipsLayer.value)==null||Lt.setVisible(!1)):(j.value=!1,Ie==null||Ie.setVisible(!1)),k("zoomChanged",_e)},he=(_e,xe)=>{const Ie=transform([_e[0],_e[1]],projection.mercator,projection.data),Oe=transform([_e[2],_e[3]],projection.mercator,projection.data);k("extentChanged",{extent:[Ie,Oe],zoom:xe})};return e({mapInstance:r,initMap:re,pointRender:(_e,xe)=>new PointMarkerClass(_e,xe),renderTrucksMarker,renderShip:renderShips,renderTrack:(_e,xe,Ie)=>{var Oe,$e;currentTrackId.value=_e,showTrackLayer.value=!0,V.value=!0,hiddenAllShips(),($e=(Oe=largeAmountShipsLayer.value)==null?void 0:Oe.getSource())==null||$e.clear(),renderTrack(_e,xe,Ie,LENGTH_UNIT.NM)},findTruck,removeTruckIcon,clearAllTruck,closeTrack:()=>{var _e,xe;showTrackLayer.value=!1,(_e=shipTrackVectorLayer.value)==null||_e.setVisible(!1),(xe=selectShipsLayer.value)==null||xe.setVisible(!0),V.value=!1,ae($.value<mapZoom.shipGreenDotMax),allTracks.value=[],stopAnimation()},closeTruckTrack:()=>{var _e,xe;showTrackLayer.value=!1,(_e=shipTrackVectorLayer.value)==null||_e.setVisible(!1),(xe=selectShipsLayer.value)==null||xe.setVisible(!0),stopAnimation()},resetTrackView,playTrack,clearSelectFeature,findShip,focusShip:(_e,xe,Ie=!0)=>{var Oe,$e;hiddenOrther.value=Ie,(Oe=shipsLayer.value)==null||Oe.setVisible(!Ie),($e=largeAmountShipsLayer.value)==null||$e.setVisible(!1),findShip(_e,xe)},showTracks,removeAllTrackLayer,switchFilterItem,rerenderShip,switchGreenDot:()=>ae(!1),zoomTruckIcon,renderTruckTrack:(_e,xe,Ie)=>{showTrackLayer.value=!0,renderTrack(_e,xe,Ie,LENGTH_UNIT.KM,"truck")},removerLayer:removeShipTrackLineFeatureByIndex,renderMarker,setMarkerPosition:_e=>{V.value=!0,setMarkerPosition(_e)},getZoomAndCenter:()=>{var $e;const _e=($e=r.value)==null?void 0:$e.getView();if(!_e)return null;const xe=Math.round(Number(_e.getZoom())),{lon:Ie,lat:Oe}=transformUtils.mercatorToLonLat(_e.getCenter());return{zoom:xe,center:[Ie,Oe]}},setCenter:_e=>{var Oe;const xe=(Oe=r.value)==null?void 0:Oe.getView();if(!xe)return null;const Ie=new Point(_e);xe.setCenter(transform(Ie.getCoordinates(),projection.data,projection.mercator))},drawPolygonTool,setMapInstance:ie,config:{mapZoom,projection},utils:{transform:transformUtils,format:formatUtils}}),(_e,xe)=>(vue.openBlock(),vue.createElementBlock("div",{class:"map-page map-container",ref_key:"pageRef",ref:i},[xe[0]||(xe[0]=vue.createElementVNode("div",{id:"map",class:"map"},null,-1)),vue.createVNode(ToolPanel,{"vehicle-mode":_e.vehicleMode,"view-mode":_e.viewMode,"disable-green-dot":V.value,"show-track-layer":vue.unref(showTrackLayer),"map-tile-mode":le.value,onSwitchGreenDot:ae,onSwitchMapTile:de},{toolPanel:vue.withCtx(()=>[vue.renderSlot(_e.$slots,"toolPanel",{},void 0,!0)]),_:3},8,["vehicle-mode","view-mode","disable-green-dot","show-track-layer","map-tile-mode"]),_e.viewMode!=="WxMiniprogram"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(ScaleLine,{ref_key:"scaleLineControl",ref:g},null,512),vue.createVNode(ZoomControl,{ref_key:"zoomControl",ref:y},null,512)],64)):vue.createCommentVNode("",!0),vue.createVNode(Copyright)],512))}}),Map$1=_export_sfc(_sfc_main$7,[["__scopeId","data-v-26faf1d8"]]),ZhMap=withInstall$1(Map$1);var zhCn={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}};/**!
703
703
  * Sortable 1.15.6
704
704
  * @author RubaXa <trash@rubaxa.org>
705
705
  * @author owenm <owen23355@gmail.com>
706
706
  * @license MIT
707
- */function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(r){_defineProperty(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _typeof(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(e){return typeof e}:_typeof=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,g;for(g=0;g<r.length;g++)i=r[g],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _objectWithoutProperties(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose(t,e),r,i;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(i=0;i<g.length;i++)r=g[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var version="1.15.6";function userAgent(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on(t,e,n){t.addEventListener(e,n,!IE11OrLess&&captureMode)}function off(t,e,n){t.removeEventListener(e,n,!IE11OrLess&&captureMode)}function matches(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function getParentOrHost(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function closest(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&matches(t,e):matches(t,e))||r&&t===n)return t;if(t===n)break}while(t=getParentOrHost(t))}return null}var R_SPACE=/\s+/g;function toggleClass(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(R_SPACE," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(R_SPACE," ")}}function css(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function matrix(t,e){var n="";if(typeof t=="string")n=t;else do{var r=css(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function find(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,g=r.length;if(n)for(;i<g;i++)n(r[i],i);return r}return[]}function getWindowScrollingElement(){var t=document.scrollingElement;return t||document.documentElement}function getRect(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var g,y,k,L,$,V,z;if(t!==window&&t.parentNode&&t!==getWindowScrollingElement()?(g=t.getBoundingClientRect(),y=g.top,k=g.left,L=g.bottom,$=g.right,V=g.height,z=g.width):(y=0,k=0,L=window.innerHeight,$=window.innerWidth,V=window.innerHeight,z=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!IE11OrLess))do if(i&&i.getBoundingClientRect&&(css(i,"transform")!=="none"||n&&css(i,"position")!=="static")){var j=i.getBoundingClientRect();y-=j.top+parseInt(css(i,"border-top-width")),k-=j.left+parseInt(css(i,"border-left-width")),L=y+g.height,$=k+g.width;break}while(i=i.parentNode);if(r&&t!==window){var oe=matrix(i||t),re=oe&&oe.a,ie=oe&&oe.d;oe&&(y/=ie,k/=re,z/=re,V/=ie,L=y+V,$=k+z)}return{top:y,left:k,bottom:L,right:$,width:z,height:V}}}function isScrolledPast(t,e,n){for(var r=getParentAutoScrollElement(t,!0),i=getRect(t)[e];r;){var g=getRect(r)[n],y=void 0;if(y=i>=g,!y)return r;if(r===getWindowScrollingElement())break;r=getParentAutoScrollElement(r,!1)}return!1}function getChild(t,e,n,r){for(var i=0,g=0,y=t.children;g<y.length;){if(y[g].style.display!=="none"&&y[g]!==Sortable.ghost&&(r||y[g]!==Sortable.dragged)&&closest(y[g],n.draggable,t,!1)){if(i===e)return y[g];i++}g++}return null}function lastChild(t,e){for(var n=t.lastElementChild;n&&(n===Sortable.ghost||css(n,"display")==="none"||e&&!matches(n,e));)n=n.previousElementSibling;return n||null}function index(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Sortable.clone&&(!e||matches(t,e))&&n++;return n}function getRelativeScrollOffset(t){var e=0,n=0,r=getWindowScrollingElement();if(t)do{var i=matrix(t),g=i.a,y=i.d;e+=t.scrollLeft*g,n+=t.scrollTop*y}while(t!==r&&(t=t.parentNode));return[e,n]}function indexOfObject(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function getParentAutoScrollElement(t,e){if(!t||!t.getBoundingClientRect)return getWindowScrollingElement();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=css(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return getWindowScrollingElement();if(r||e)return n;r=!0}}while(n=n.parentNode);return getWindowScrollingElement()}function extend(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function isRectEqual(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var _throttleTimeout;function throttle(t,e){return function(){if(!_throttleTimeout){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),_throttleTimeout=setTimeout(function(){_throttleTimeout=void 0},e)}}}function cancelThrottle(){clearTimeout(_throttleTimeout),_throttleTimeout=void 0}function scrollBy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function clone(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function getChildContainingRectFromElement(t,e,n){var r={};return Array.from(t.children).forEach(function(i){var g,y,k,L;if(!(!closest(i,e.draggable,t,!1)||i.animated||i===n)){var $=getRect(i);r.left=Math.min((g=r.left)!==null&&g!==void 0?g:1/0,$.left),r.top=Math.min((y=r.top)!==null&&y!==void 0?y:1/0,$.top),r.right=Math.max((k=r.right)!==null&&k!==void 0?k:-1/0,$.right),r.bottom=Math.max((L=r.bottom)!==null&&L!==void 0?L:-1/0,$.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var expando="Sortable"+new Date().getTime();function AnimationStateManager(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(css(i,"display")==="none"||i===Sortable.ghost)){t.push({target:i,rect:getRect(i)});var g=_objectSpread2({},t[t.length-1].rect);if(i.thisAnimationDuration){var y=matrix(i,!0);y&&(g.top-=y.f,g.left-=y.e)}i.fromRect=g}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(indexOfObject(t,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var g=!1,y=0;t.forEach(function(k){var L=0,$=k.target,V=$.fromRect,z=getRect($),j=$.prevFromRect,oe=$.prevToRect,re=k.rect,ie=matrix($,!0);ie&&(z.top-=ie.f,z.left-=ie.e),$.toRect=z,$.thisAnimationDuration&&isRectEqual(j,z)&&!isRectEqual(V,z)&&(re.top-z.top)/(re.left-z.left)===(V.top-z.top)/(V.left-z.left)&&(L=calculateRealTime(re,j,oe,i.options)),isRectEqual(z,V)||($.prevFromRect=V,$.prevToRect=z,L||(L=i.options.animation),i.animate($,re,z,L)),L&&(g=!0,y=Math.max(y,L),clearTimeout($.animationResetTimer),$.animationResetTimer=setTimeout(function(){$.animationTime=0,$.prevFromRect=null,$.fromRect=null,$.prevToRect=null,$.thisAnimationDuration=null},L),$.thisAnimationDuration=L)}),clearTimeout(e),g?e=setTimeout(function(){typeof r=="function"&&r()},y):typeof r=="function"&&r(),t=[]},animate:function(r,i,g,y){if(y){css(r,"transition",""),css(r,"transform","");var k=matrix(this.el),L=k&&k.a,$=k&&k.d,V=(i.left-g.left)/(L||1),z=(i.top-g.top)/($||1);r.animatingX=!!V,r.animatingY=!!z,css(r,"transform","translate3d("+V+"px,"+z+"px,0)"),this.forRepaintDummy=repaint(r),css(r,"transition","transform "+y+"ms"+(this.options.easing?" "+this.options.easing:"")),css(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){css(r,"transition",""),css(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},y)}}}}function repaint(t){return t.offsetWidth}function calculateRealTime(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var plugins=[],defaults={initializeByDefault:!0},PluginManager={mount:function t(e){for(var n in defaults)defaults.hasOwnProperty(n)&&!(n in e)&&(e[n]=defaults[n]);plugins.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),plugins.push(e)},pluginEvent:function t(e,n,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var g=e+"Global";plugins.forEach(function(y){n[y.pluginName]&&(n[y.pluginName][g]&&n[y.pluginName][g](_objectSpread2({sortable:n},r)),n.options[y.pluginName]&&n[y.pluginName][e]&&n[y.pluginName][e](_objectSpread2({sortable:n},r)))})},initializePlugins:function t(e,n,r,i){plugins.forEach(function(k){var L=k.pluginName;if(!(!e.options[L]&&!k.initializeByDefault)){var $=new k(e,n,e.options);$.sortable=e,$.options=e.options,e[L]=$,_extends(r,$.defaults)}});for(var g in e.options)if(e.options.hasOwnProperty(g)){var y=this.modifyOption(e,g,e.options[g]);typeof y<"u"&&(e.options[g]=y)}},getEventProperties:function t(e,n){var r={};return plugins.forEach(function(i){typeof i.eventProperties=="function"&&_extends(r,i.eventProperties.call(n[i.pluginName],e))}),r},modifyOption:function t(e,n,r){var i;return plugins.forEach(function(g){e[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[n]=="function"&&(i=g.optionListeners[n].call(e[g.pluginName],r))}),i}};function dispatchEvent(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,g=t.cloneEl,y=t.toEl,k=t.fromEl,L=t.oldIndex,$=t.newIndex,V=t.oldDraggableIndex,z=t.newDraggableIndex,j=t.originalEvent,oe=t.putSortable,re=t.extraEventProperties;if(e=e||n&&n[expando],!!e){var ie,ae=e.options,le="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!IE11OrLess&&!Edge?ie=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(ie=document.createEvent("Event"),ie.initEvent(r,!0,!0)),ie.to=y||n,ie.from=k||n,ie.item=i||n,ie.clone=g,ie.oldIndex=L,ie.newIndex=$,ie.oldDraggableIndex=V,ie.newDraggableIndex=z,ie.originalEvent=j,ie.pullMode=oe?oe.lastPutMode:void 0;var de=_objectSpread2(_objectSpread2({},re),PluginManager.getEventProperties(r,e));for(var pe in de)ie[pe]=de[pe];n&&n.dispatchEvent(ie),ae[le]&&ae[le].call(e,ie)}}var _excluded=["evt"],pluginEvent=function t(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,g=_objectWithoutProperties(r,_excluded);PluginManager.pluginEvent.bind(Sortable)(e,n,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:i,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(k){_dispatchEvent({sortable:n,name:k,originalEvent:i})}},g))};function _dispatchEvent(t){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},t))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),_detectDirection=function t(e,n){var r=css(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),g=getChild(e,0,n),y=getChild(e,1,n),k=g&&css(g),L=y&&css(y),$=k&&parseInt(k.marginLeft)+parseInt(k.marginRight)+getRect(g).width,V=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+getRect(y).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&k.float&&k.float!=="none"){var z=k.float==="left"?"left":"right";return y&&(L.clear==="both"||L.clear===z)?"vertical":"horizontal"}return g&&(k.display==="block"||k.display==="flex"||k.display==="table"||k.display==="grid"||$>=i&&r[CSSFloatProperty]==="none"||y&&r[CSSFloatProperty]==="none"&&$+V>i)?"vertical":"horizontal"},_dragElInRowColumn=function t(e,n,r){var i=r?e.left:e.top,g=r?e.right:e.bottom,y=r?e.width:e.height,k=r?n.left:n.top,L=r?n.right:n.bottom,$=r?n.width:n.height;return i===k||g===L||i+y/2===k+$/2},_detectNearestEmptySortable=function t(e,n){var r;return sortables.some(function(i){var g=i[expando].options.emptyInsertThreshold;if(!(!g||lastChild(i))){var y=getRect(i),k=e>=y.left-g&&e<=y.right+g,L=n>=y.top-g&&n<=y.bottom+g;if(k&&L)return r=i}}),r},_prepareGroup=function t(e){function n(g,y){return function(k,L,$,V){var z=k.options.group.name&&L.options.group.name&&k.options.group.name===L.options.group.name;if(g==null&&(y||z))return!0;if(g==null||g===!1)return!1;if(y&&g==="clone")return g;if(typeof g=="function")return n(g(k,L,$,V),y)(k,L,$,V);var j=(y?k:L).options.group.name;return g===!0||typeof g=="string"&&g===j||g.join&&g.indexOf(j)>-1}}var r={},i=e.group;(!i||_typeof(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,e.group=r},_hideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","none")},_unhideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","")};documentExists&&!ChromeForAndroid&&document.addEventListener("click",function(t){if(ignoreNextClick)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function t(e){if(dragEl){e=e.touches?e.touches[0]:e;var n=_detectNearestEmptySortable(e.clientX,e.clientY);if(n){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[expando]._onDragOver(r)}}},_checkOutsideTargetEl=function t(e){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(e.target)};function Sortable(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=_extends({},e),t[expando]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(y,k){y.setData("Text",k.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&(!Safari||IOS),emptyInsertThreshold:5};PluginManager.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);_prepareGroup(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?on(t,"pointerdown",this._onTapStart):(on(t,"mousedown",this._onTapStart),on(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(on(t,"dragover",this),on(t,"dragenter",this)),sortables.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function t(e){!this.el.contains(e)&&e!==this.el&&(lastTarget=null)},_getDirection:function t(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,dragEl):this.options.direction},_onTapStart:function t(e){if(e.cancelable){var n=this,r=this.el,i=this.options,g=i.preventOnFilter,y=e.type,k=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,L=(k||e).target,$=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||L,V=i.filter;if(_saveInputCheckedState(r),!dragEl&&!(/mousedown|pointerdown/.test(y)&&e.button!==0||i.disabled)&&!$.isContentEditable&&!(!this.nativeDraggable&&Safari&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=closest(L,i.draggable,r,!1),!(L&&L.animated)&&lastDownEl!==L)){if(oldIndex=index(L),oldDraggableIndex=index(L,i.draggable),typeof V=="function"){if(V.call(this,e,L,this)){_dispatchEvent({sortable:n,rootEl:$,name:"filter",targetEl:L,toEl:r,fromEl:r}),pluginEvent("filter",n,{evt:e}),g&&e.preventDefault();return}}else if(V&&(V=V.split(",").some(function(z){if(z=closest($,z.trim(),r,!1),z)return _dispatchEvent({sortable:n,rootEl:z,name:"filter",targetEl:L,fromEl:r,toEl:r}),pluginEvent("filter",n,{evt:e}),!0}),V)){g&&e.preventDefault();return}i.handle&&!closest($,i.handle,r,!1)||this._prepareDragStart(e,k,L)}}},_prepareDragStart:function t(e,n,r){var i=this,g=i.el,y=i.options,k=g.ownerDocument,L;if(r&&!dragEl&&r.parentNode===g){var $=getRect(r);if(rootEl=g,dragEl=r,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=r,activeGroup=y.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(n||e).clientX,clientY:(n||e).clientY},tapDistanceLeft=tapEvt.clientX-$.left,tapDistanceTop=tapEvt.clientY-$.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,dragEl.style["will-change"]="all",L=function(){if(pluginEvent("delayEnded",i,{evt:e}),Sortable.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!FireFox&&i.nativeDraggable&&(dragEl.draggable=!0),i._triggerDragStart(e,n),_dispatchEvent({sortable:i,name:"choose",originalEvent:e}),toggleClass(dragEl,y.chosenClass,!0)},y.ignore.split(",").forEach(function(V){find(dragEl,V.trim(),_disableDraggable)}),on(k,"dragover",nearestEmptyInsertDetectEvent),on(k,"mousemove",nearestEmptyInsertDetectEvent),on(k,"touchmove",nearestEmptyInsertDetectEvent),y.supportPointer?(on(k,"pointerup",i._onDrop),!this.nativeDraggable&&on(k,"pointercancel",i._onDrop)):(on(k,"mouseup",i._onDrop),on(k,"touchend",i._onDrop),on(k,"touchcancel",i._onDrop)),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:e}),y.delay&&(!y.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}y.supportPointer?(on(k,"pointerup",i._disableDelayedDrag),on(k,"pointercancel",i._disableDelayedDrag)):(on(k,"mouseup",i._disableDelayedDrag),on(k,"touchend",i._disableDelayedDrag),on(k,"touchcancel",i._disableDelayedDrag)),on(k,"mousemove",i._delayedDragTouchMoveHandler),on(k,"touchmove",i._delayedDragTouchMoveHandler),y.supportPointer&&on(k,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(L,y.delay)}else L()}},_delayedDragTouchMoveHandler:function t(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function t(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._disableDelayedDrag),off(e,"touchend",this._disableDelayedDrag),off(e,"touchcancel",this._disableDelayedDrag),off(e,"pointerup",this._disableDelayedDrag),off(e,"pointercancel",this._disableDelayedDrag),off(e,"mousemove",this._delayedDragTouchMoveHandler),off(e,"touchmove",this._delayedDragTouchMoveHandler),off(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function t(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?on(document,"pointermove",this._onTouchMove):n?on(document,"touchmove",this._onTouchMove):on(document,"mousemove",this._onTouchMove):(on(dragEl,"dragend",this),on(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function t(e,n){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:n}),this.nativeDraggable&&on(document,"dragover",_checkOutsideTargetEl);var r=this.options;!e&&toggleClass(dragEl,r.dragClass,!1),toggleClass(dragEl,r.ghostClass,!0),Sortable.active=this,e&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function t(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var e=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),e!==n);)n=e;if(dragEl.parentNode[expando]._isOutsideThisEl(e),n)do{if(n[expando]){var r=void 0;if(r=n[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:e,rootEl:n}),r&&!this.options.dragoverBubble)break}e=n}while(n=getParentOrHost(n));_unhideGhostForTarget()}},_onTouchMove:function t(e){if(tapEvt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,g=e.touches?e.touches[0]:e,y=ghostEl&&matrix(ghostEl,!0),k=ghostEl&&y&&y.a,L=ghostEl&&y&&y.d,$=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),V=(g.clientX-tapEvt.clientX+i.x)/(k||1)+($?$[0]-ghostRelativeParentInitialScroll[0]:0)/(k||1),z=(g.clientY-tapEvt.clientY+i.y)/(L||1)+($?$[1]-ghostRelativeParentInitialScroll[1]:0)/(L||1);if(!Sortable.active&&!awaitingDragStarted){if(r&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(ghostEl){y?(y.e+=V-(lastDx||0),y.f+=z-(lastDy||0)):y={a:1,b:0,c:0,d:1,e:V,f:z};var j="matrix(".concat(y.a,",").concat(y.b,",").concat(y.c,",").concat(y.d,",").concat(y.e,",").concat(y.f,")");css(ghostEl,"webkitTransform",j),css(ghostEl,"mozTransform",j),css(ghostEl,"msTransform",j),css(ghostEl,"transform",j),lastDx=V,lastDy=z,touchEvt=g}e.cancelable&&e.preventDefault()}},_appendGhost:function t(){if(!ghostEl){var e=this.options.fallbackOnBody?document.body:rootEl,n=getRect(dragEl,!0,PositionGhostAbsolutely,!0,e),r=this.options;if(PositionGhostAbsolutely){for(ghostRelativeParent=e;css(ghostRelativeParent,"position")==="static"&&css(ghostRelativeParent,"transform")==="none"&&ghostRelativeParent!==document;)ghostRelativeParent=ghostRelativeParent.parentNode;ghostRelativeParent!==document.body&&ghostRelativeParent!==document.documentElement?(ghostRelativeParent===document&&(ghostRelativeParent=getWindowScrollingElement()),n.top+=ghostRelativeParent.scrollTop,n.left+=ghostRelativeParent.scrollLeft):ghostRelativeParent=getWindowScrollingElement(),ghostRelativeParentInitialScroll=getRelativeScrollOffset(ghostRelativeParent)}ghostEl=dragEl.cloneNode(!0),toggleClass(ghostEl,r.ghostClass,!1),toggleClass(ghostEl,r.fallbackClass,!0),toggleClass(ghostEl,r.dragClass,!0),css(ghostEl,"transition",""),css(ghostEl,"transform",""),css(ghostEl,"box-sizing","border-box"),css(ghostEl,"margin",0),css(ghostEl,"top",n.top),css(ghostEl,"left",n.left),css(ghostEl,"width",n.width),css(ghostEl,"height",n.height),css(ghostEl,"opacity","0.8"),css(ghostEl,"position",PositionGhostAbsolutely?"absolute":"fixed"),css(ghostEl,"zIndex","100000"),css(ghostEl,"pointerEvents","none"),Sortable.ghost=ghostEl,e.appendChild(ghostEl),css(ghostEl,"transform-origin",tapDistanceLeft/parseInt(ghostEl.style.width)*100+"% "+tapDistanceTop/parseInt(ghostEl.style.height)*100+"%")}},_onDragStart:function t(e,n){var r=this,i=e.dataTransfer,g=r.options;if(pluginEvent("dragStart",this,{evt:e}),Sortable.eventCanceled){this._onDrop();return}pluginEvent("setupClone",this),Sortable.eventCanceled||(cloneEl=clone(dragEl),cloneEl.removeAttribute("id"),cloneEl.draggable=!1,cloneEl.style["will-change"]="",this._hideClone(),toggleClass(cloneEl,this.options.chosenClass,!1),Sortable.clone=cloneEl),r.cloneId=_nextTick(function(){pluginEvent("clone",r),!Sortable.eventCanceled&&(r.options.removeCloneOnHide||rootEl.insertBefore(cloneEl,dragEl),r._hideClone(),_dispatchEvent({sortable:r,name:"clone"}))}),!n&&toggleClass(dragEl,g.dragClass,!0),n?(ignoreNextClick=!0,r._loopId=setInterval(r._emulateDragOver,50)):(off(document,"mouseup",r._onDrop),off(document,"touchend",r._onDrop),off(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",g.setData&&g.setData.call(r,i,dragEl)),on(document,"drop",r),css(dragEl,"transform","translateZ(0)")),awaitingDragStarted=!0,r._dragStartId=_nextTick(r._dragStarted.bind(r,n,e)),on(document,"selectstart",r),moved=!0,window.getSelection().removeAllRanges(),Safari&&css(document.body,"user-select","none")},_onDragOver:function t(e){var n=this.el,r=e.target,i,g,y,k=this.options,L=k.group,$=Sortable.active,V=activeGroup===L,z=k.sort,j=putSortable||$,oe,re=this,ie=!1;if(_silent)return;function ae(Ue,Ne){pluginEvent(Ue,re,_objectSpread2({evt:e,isOwner:V,axis:oe?"vertical":"horizontal",revert:y,dragRect:i,targetRect:g,canSort:z,fromSortable:j,target:r,completed:de,onMove:function(kt,hn){return _onMove(rootEl,n,dragEl,i,kt,getRect(kt),e,hn)},changed:pe},Ne))}function le(){ae("dragOverAnimationCapture"),re.captureAnimationState(),re!==j&&j.captureAnimationState()}function de(Ue){return ae("dragOverCompleted",{insertion:Ue}),Ue&&(V?$._hideClone():$._showClone(re),re!==j&&(toggleClass(dragEl,putSortable?putSortable.options.ghostClass:$.options.ghostClass,!1),toggleClass(dragEl,k.ghostClass,!0)),putSortable!==re&&re!==Sortable.active?putSortable=re:re===Sortable.active&&putSortable&&(putSortable=null),j===re&&(re._ignoreWhileAnimating=r),re.animateAll(function(){ae("dragOverAnimationComplete"),re._ignoreWhileAnimating=null}),re!==j&&(j.animateAll(),j._ignoreWhileAnimating=null)),(r===dragEl&&!dragEl.animated||r===n&&!r.animated)&&(lastTarget=null),!k.dragoverBubble&&!e.rootEl&&r!==document&&(dragEl.parentNode[expando]._isOutsideThisEl(e.target),!Ue&&nearestEmptyInsertDetectEvent(e)),!k.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),ie=!0}function pe(){newIndex=index(dragEl),newDraggableIndex=index(dragEl,k.draggable),_dispatchEvent({sortable:re,name:"change",toEl:n,newIndex,newDraggableIndex,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=closest(r,k.draggable,n,!0),ae("dragOver"),Sortable.eventCanceled)return ie;if(dragEl.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||re._ignoreWhileAnimating===r)return de(!1);if(ignoreNextClick=!1,$&&!k.disabled&&(V?z||(y=parentEl!==rootEl):putSortable===this||(this.lastPutMode=activeGroup.checkPull(this,$,dragEl,e))&&L.checkPut(this,$,dragEl,e))){if(oe=this._getDirection(e,r)==="vertical",i=getRect(dragEl),ae("dragOverValid"),Sortable.eventCanceled)return ie;if(y)return parentEl=rootEl,le(),this._hideClone(),ae("revert"),Sortable.eventCanceled||(nextEl?rootEl.insertBefore(dragEl,nextEl):rootEl.appendChild(dragEl)),de(!0);var ue=lastChild(n,k.draggable);if(!ue||_ghostIsLast(e,oe,this)&&!ue.animated){if(ue===dragEl)return de(!1);if(ue&&n===e.target&&(r=ue),r&&(g=getRect(r)),_onMove(rootEl,n,dragEl,i,r,g,e,!!r)!==!1)return le(),ue&&ue.nextSibling?n.insertBefore(dragEl,ue.nextSibling):n.appendChild(dragEl),parentEl=n,pe(),de(!0)}else if(ue&&_ghostIsFirst(e,oe,this)){var he=getChild(n,0,k,!0);if(he===dragEl)return de(!1);if(r=he,g=getRect(r),_onMove(rootEl,n,dragEl,i,r,g,e,!1)!==!1)return le(),n.insertBefore(dragEl,he),parentEl=n,pe(),de(!0)}else if(r.parentNode===n){g=getRect(r);var Ce=0,_e,xe=dragEl.parentNode!==n,Ie=!_dragElInRowColumn(dragEl.animated&&dragEl.toRect||i,r.animated&&r.toRect||g,oe),Oe=oe?"top":"left",$e=isScrolledPast(r,"top","top")||isScrolledPast(dragEl,"top","top"),qe=$e?$e.scrollTop:void 0;lastTarget!==r&&(_e=g[Oe],pastFirstInvertThresh=!1,isCircumstantialInvert=!Ie&&k.invertSwap||xe),Ce=_getSwapDirection(e,r,g,oe,Ie?1:k.swapThreshold,k.invertedSwapThreshold==null?k.swapThreshold:k.invertedSwapThreshold,isCircumstantialInvert,lastTarget===r);var Pt;if(Ce!==0){var Lt=index(dragEl);do Lt-=Ce,Pt=parentEl.children[Lt];while(Pt&&(css(Pt,"display")==="none"||Pt===ghostEl))}if(Ce===0||Pt===r)return de(!1);lastTarget=r,lastDirection=Ce;var Ve=r.nextElementSibling,Fe=!1;Fe=Ce===1;var ze=_onMove(rootEl,n,dragEl,i,r,g,e,Fe);if(ze!==!1)return(ze===1||ze===-1)&&(Fe=ze===1),_silent=!0,setTimeout(_unsilent,30),le(),Fe&&!Ve?n.appendChild(dragEl):r.parentNode.insertBefore(dragEl,Fe?Ve:r),$e&&scrollBy($e,0,qe-$e.scrollTop),parentEl=dragEl.parentNode,_e!==void 0&&!isCircumstantialInvert&&(targetMoveDistance=Math.abs(_e-getRect(r)[Oe])),pe(),de(!0)}if(n.contains(dragEl))return de(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function t(){off(document,"mousemove",this._onTouchMove),off(document,"touchmove",this._onTouchMove),off(document,"pointermove",this._onTouchMove),off(document,"dragover",nearestEmptyInsertDetectEvent),off(document,"mousemove",nearestEmptyInsertDetectEvent),off(document,"touchmove",nearestEmptyInsertDetectEvent)},_offUpEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._onDrop),off(e,"touchend",this._onDrop),off(e,"pointerup",this._onDrop),off(e,"pointercancel",this._onDrop),off(e,"touchcancel",this._onDrop),off(document,"selectstart",this)},_onDrop:function t(e){var n=this.el,r=this.options;if(newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),pluginEvent("drop",this,{evt:e}),parentEl=dragEl&&dragEl.parentNode,newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),Sortable.eventCanceled){this._nulling();return}awaitingDragStarted=!1,isCircumstantialInvert=!1,pastFirstInvertThresh=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_cancelNextTick(this.cloneId),_cancelNextTick(this._dragStartId),this.nativeDraggable&&(off(document,"drop",this),off(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Safari&&css(document.body,"user-select",""),css(dragEl,"transform",""),e&&(moved&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),ghostEl&&ghostEl.parentNode&&ghostEl.parentNode.removeChild(ghostEl),(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=="clone")&&cloneEl&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),dragEl&&(this.nativeDraggable&&off(dragEl,"dragend",this),_disableDraggable(dragEl),dragEl.style["will-change"]="",moved&&!awaitingDragStarted&&toggleClass(dragEl,putSortable?putSortable.options.ghostClass:this.options.ghostClass,!1),toggleClass(dragEl,this.options.chosenClass,!1),_dispatchEvent({sortable:this,name:"unchoose",toEl:parentEl,newIndex:null,newDraggableIndex:null,originalEvent:e}),rootEl!==parentEl?(newIndex>=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:e}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:e}),this.save()))),this._nulling()},_nulling:function t(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(e){e.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function t(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(e),_globalDragOver(e));break;case"selectstart":e.preventDefault();break}},toArray:function t(){for(var e=[],n,r=this.el.children,i=0,g=r.length,y=this.options;i<g;i++)n=r[i],closest(n,y.draggable,this.el,!1)&&e.push(n.getAttribute(y.dataIdAttr)||_generateId(n));return e},sort:function t(e,n){var r={},i=this.el;this.toArray().forEach(function(g,y){var k=i.children[y];closest(k,this.options.draggable,i,!1)&&(r[g]=k)},this),n&&this.captureAnimationState(),e.forEach(function(g){r[g]&&(i.removeChild(r[g]),i.appendChild(r[g]))}),n&&this.animateAll()},save:function t(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function t(e,n){return closest(e,n||this.options.draggable,this.el,!1)},option:function t(e,n){var r=this.options;if(n===void 0)return r[e];var i=PluginManager.modifyOption(this,e,n);typeof i<"u"?r[e]=i:r[e]=n,e==="group"&&_prepareGroup(r)},destroy:function t(){pluginEvent("destroy",this);var e=this.el;e[expando]=null,off(e,"mousedown",this._onTapStart),off(e,"touchstart",this._onTapStart),off(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(off(e,"dragover",this),off(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),sortables.splice(sortables.indexOf(this.el),1),this.el=e=null},_hideClone:function t(){if(!cloneHidden){if(pluginEvent("hideClone",this),Sortable.eventCanceled)return;css(cloneEl,"display","none"),this.options.removeCloneOnHide&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),cloneHidden=!0}},_showClone:function t(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(cloneHidden){if(pluginEvent("showClone",this),Sortable.eventCanceled)return;dragEl.parentNode==rootEl&&!this.options.group.revertClone?rootEl.insertBefore(cloneEl,dragEl):nextEl?rootEl.insertBefore(cloneEl,nextEl):rootEl.appendChild(cloneEl),this.options.group.revertClone&&this.animate(dragEl,cloneEl),css(cloneEl,"display",""),cloneHidden=!1}}};function _globalDragOver(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function _onMove(t,e,n,r,i,g,y,k){var L,$=t[expando],V=$.options.onMove,z;return window.CustomEvent&&!IE11OrLess&&!Edge?L=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(L=document.createEvent("Event"),L.initEvent("move",!0,!0)),L.to=e,L.from=t,L.dragged=n,L.draggedRect=r,L.related=i||e,L.relatedRect=g||getRect(e),L.willInsertAfter=k,L.originalEvent=y,t.dispatchEvent(L),V&&(z=V.call($,L,y)),z}function _disableDraggable(t){t.draggable=!1}function _unsilent(){_silent=!1}function _ghostIsFirst(t,e,n){var r=getRect(getChild(n.el,0,n.options,!0)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX<i.left-g||t.clientY<r.top&&t.clientX<r.right:t.clientY<i.top-g||t.clientY<r.bottom&&t.clientX<r.left}function _ghostIsLast(t,e,n){var r=getRect(lastChild(n.el,n.options.draggable)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX>i.right+g||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>i.bottom+g||t.clientX>r.right&&t.clientY>r.top}function _getSwapDirection(t,e,n,r,i,g,y,k){var L=r?t.clientY:t.clientX,$=r?n.height:n.width,V=r?n.top:n.left,z=r?n.bottom:n.right,j=!1;if(!y){if(k&&targetMoveDistance<$*i){if(!pastFirstInvertThresh&&(lastDirection===1?L>V+$*g/2:L<z-$*g/2)&&(pastFirstInvertThresh=!0),pastFirstInvertThresh)j=!0;else if(lastDirection===1?L<V+targetMoveDistance:L>z-targetMoveDistance)return-lastDirection}else if(L>V+$*(1-i)/2&&L<z-$*(1-i)/2)return _getInsertDirection(e)}return j=j||y,j&&(L<V+$*g/2||L>z-$*g/2)?L>V+$/2?1:-1:0}function _getInsertDirection(t){return index(dragEl)<index(t)?1:-1}function _generateId(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function _saveInputCheckedState(t){savedInputChecked.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&savedInputChecked.push(r)}}function _nextTick(t){return setTimeout(t,0)}function _cancelNextTick(t){return clearTimeout(t)}documentExists&&on(document,"touchmove",function(t){(Sortable.active||awaitingDragStarted)&&t.cancelable&&t.preventDefault()}),Sortable.utils={on,off,css,find,is:function t(e,n){return!!closest(e,n,e,!1)},extend,throttle,closest,toggleClass,clone,index,nextTick:_nextTick,cancelNextTick:_cancelNextTick,detectDirection:_detectDirection,getChild,expando},Sortable.get=function(t){return t[expando]},Sortable.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Sortable.utils=_objectSpread2(_objectSpread2({},Sortable.utils),r.utils)),PluginManager.mount(r)})},Sortable.create=function(t,e){return new Sortable(t,e)},Sortable.version=version;var autoScrolls=[],scrollEl,scrollRootEl,scrolling=!1,lastAutoScrollX,lastAutoScrollY,touchEvt$1,pointerElemChangedInterval;function AutoScrollPlugin(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?on(document,"dragover",this._handleAutoScroll):this.options.supportPointer?on(document,"pointermove",this._handleFallbackAutoScroll):r.touches?on(document,"touchmove",this._handleFallbackAutoScroll):on(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?off(document,"dragover",this._handleAutoScroll):(off(document,"pointermove",this._handleFallbackAutoScroll),off(document,"touchmove",this._handleFallbackAutoScroll),off(document,"mousemove",this._handleFallbackAutoScroll)),clearPointerElemChangedInterval(),clearAutoScrolls(),cancelThrottle()},nulling:function(){touchEvt$1=scrollRootEl=scrollEl=scrolling=pointerElemChangedInterval=lastAutoScrollX=lastAutoScrollY=null,autoScrolls.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var i=this,g=(n.touches?n.touches[0]:n).clientX,y=(n.touches?n.touches[0]:n).clientY,k=document.elementFromPoint(g,y);if(touchEvt$1=n,r||this.options.forceAutoScrollFallback||Edge||IE11OrLess||Safari){autoScroll(n,this.options,k,r);var L=getParentAutoScrollElement(k,!0);scrolling&&(!pointerElemChangedInterval||g!==lastAutoScrollX||y!==lastAutoScrollY)&&(pointerElemChangedInterval&&clearPointerElemChangedInterval(),pointerElemChangedInterval=setInterval(function(){var $=getParentAutoScrollElement(document.elementFromPoint(g,y),!0);$!==L&&(L=$,clearAutoScrolls()),autoScroll(n,i.options,$,r)},10),lastAutoScrollX=g,lastAutoScrollY=y)}else{if(!this.options.bubbleScroll||getParentAutoScrollElement(k,!0)===getWindowScrollingElement()){clearAutoScrolls();return}autoScroll(n,this.options,getParentAutoScrollElement(k,!1),!1)}}},_extends(t,{pluginName:"scroll",initializeByDefault:!0})}function clearAutoScrolls(){autoScrolls.forEach(function(t){clearInterval(t.pid)}),autoScrolls=[]}function clearPointerElemChangedInterval(){clearInterval(pointerElemChangedInterval)}var autoScroll=throttle(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,y=e.scrollSensitivity,k=e.scrollSpeed,L=getWindowScrollingElement(),$=!1,V;scrollRootEl!==n&&(scrollRootEl=n,clearAutoScrolls(),scrollEl=e.scroll,V=e.scrollFn,scrollEl===!0&&(scrollEl=getParentAutoScrollElement(n,!0)));var z=0,j=scrollEl;do{var oe=j,re=getRect(oe),ie=re.top,ae=re.bottom,le=re.left,de=re.right,pe=re.width,ue=re.height,he=void 0,Ce=void 0,_e=oe.scrollWidth,xe=oe.scrollHeight,Ie=css(oe),Oe=oe.scrollLeft,$e=oe.scrollTop;oe===L?(he=pe<_e&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"||Ie.overflowX==="visible"),Ce=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"||Ie.overflowY==="visible")):(he=pe<_e&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"),Ce=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"));var qe=he&&(Math.abs(de-i)<=y&&Oe+pe<_e)-(Math.abs(le-i)<=y&&!!Oe),Pt=Ce&&(Math.abs(ae-g)<=y&&$e+ue<xe)-(Math.abs(ie-g)<=y&&!!$e);if(!autoScrolls[z])for(var Lt=0;Lt<=z;Lt++)autoScrolls[Lt]||(autoScrolls[Lt]={});(autoScrolls[z].vx!=qe||autoScrolls[z].vy!=Pt||autoScrolls[z].el!==oe)&&(autoScrolls[z].el=oe,autoScrolls[z].vx=qe,autoScrolls[z].vy=Pt,clearInterval(autoScrolls[z].pid),(qe!=0||Pt!=0)&&($=!0,autoScrolls[z].pid=setInterval((function(){r&&this.layer===0&&Sortable.active._onTouchMove(touchEvt$1);var Ve=autoScrolls[this.layer].vy?autoScrolls[this.layer].vy*k:0,Fe=autoScrolls[this.layer].vx?autoScrolls[this.layer].vx*k:0;typeof V=="function"&&V.call(Sortable.dragged.parentNode[expando],Fe,Ve,t,touchEvt$1,autoScrolls[this.layer].el)!=="continue"||scrollBy(autoScrolls[this.layer].el,Fe,Ve)}).bind({layer:z}),24))),z++}while(e.bubbleScroll&&j!==L&&(j=getParentAutoScrollElement(j,!1)));scrolling=$}},30),drop=function t(e){var n=e.originalEvent,r=e.putSortable,i=e.dragEl,g=e.activeSortable,y=e.dispatchSortableEvent,k=e.hideGhostForTarget,L=e.unhideGhostForTarget;if(n){var $=r||g;k();var V=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,z=document.elementFromPoint(V.clientX,V.clientY);L(),$&&!$.el.contains(z)&&(y("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Revert(){}Revert.prototype={startIndex:null,dragStart:function t(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function t(e){var n=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=getChild(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop},_extends(Revert,{pluginName:"revertOnSpill"});function Remove(){}Remove.prototype={onSpill:function t(e){var n=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop},_extends(Remove,{pluginName:"removeOnSpill"}),Sortable.mount(new AutoScrollPlugin),Sortable.mount(Remove,Revert);const useTable=(t,e={},n=!0,r,i,g=y=>y)=>{const y=vue.reactive({tableData:[],pageable:{page:1,size:10,total:0},searchParam:{},searchInitParam:{},totalParam:{},loading:!1}),k=vue.computed({get:()=>({page:y.pageable.page,size:y.pageable.size}),set:ie=>{console.log("我是分页更新之后的值",ie)}}),L=async()=>{if(y.loading=!0,!t){y.loading=!1;return}try{const ie=localStorage.getItem("MytaskGotoListPageQuery");if(ie){e={},y.totalParam={};const le=JSON.parse(ie);e={...e,...le},y.searchParam={...le}}Object.assign(y.totalParam,e,n?k.value:{});for(const le in y.searchParam)y.searchParam[le]===""&&delete y.searchParam[le];let ae=await t(g({...y.searchInitParam,...y.totalParam}));if(r&&(ae=await r(ae)),y.tableData=n?ae.list:ae,n){const{currentPage:le,pageSize:de,total:pe}=ae;V({page:le,size:de,total:pe})}}catch(ie){i&&i(ie)}finally{y.loading=!1}},$=()=>{y.totalParam={},y.searchInitParam={},e={};const ie={};for(const ae in y.searchParam)(y.searchParam[ae]||y.searchParam[ae]===!1||y.searchParam[ae]===0)&&(ie[ae]=y.searchParam[ae]);Object.assign(y.totalParam,ie,n?k.value:{})},V=ie=>{Object.assign(y.pageable,ie)},z=()=>{y.pageable.page=1,$(),L().then()},j=()=>{y.pageable.page=1,y.searchParam={...y.searchInitParam},$(),L().then()},oe=ie=>{y.pageable.page=1,y.pageable.size=ie,L().then()},re=ie=>{y.pageable.page=ie,L().then()};return{...vue.toRefs(y),getTableList:L,search:z,reset:j,handleSizeChange:oe,handleCurrentChange:re,updatedTotalParam:$}},useSelection=(t="id",e)=>{const n=vue.ref(!1),r=vue.ref([]),i=vue.computed(()=>{let y=[];return r.value.forEach(k=>y.push(get$5(k,t))),y});return{isSelected:n,selectedList:r,selectedListIds:i,selectionChange:y=>{y.length?n.value=!0:n.value=!1,r.value=y,e&&e(y)}}},_hoisted_1$5={class:"search-form-item"},_sfc_main$6=vue.defineComponent({name:"SearchFormItem",__name:"SearchFormItem",props:{column:{},searchParam:{}},emits:["search"],setup(t,{emit:e}){vue.useCssVars(ae=>({"054b42e2":z.value}));const n=t,r=e,i=vue.computed(()=>n.searchParam),g=vue.computed(()=>{var ae,le,de;return{label:((ae=n.column.fieldNames)==null?void 0:ae.label)??"label",value:((le=n.column.fieldNames)==null?void 0:le.value)??"value",children:((de=n.column.fieldNames)==null?void 0:de.children)??"children"}}),y=vue.inject("enumMap",vue.ref(new Map)),k=vue.computed(()=>{var le;let ae=y.value.get(n.column.prop);return ae?(((le=n.column.search)==null?void 0:le.el)==="select-v2"&&n.column.fieldNames&&(ae=ae.map(de=>({...de,label:de[g.value.label],value:de[g.value.value]}))),ae):[]}),L=vue.computed(()=>{var ae,le;return((le=(ae=n.column.search)==null?void 0:ae.props)==null?void 0:le.options)??k.value??[]}),$=vue.computed(()=>{var he,Ce;const ae=g.value.label,le=g.value.value,de=g.value.children,pe=(he=n.column.search)==null?void 0:he.el;let ue=((Ce=n.column.search)==null?void 0:Ce.props)??{};return pe==="tree-select"&&(ue={...ue,props:{...ue.props,label:ae,children:de},nodeKey:le}),pe==="cascader"&&(ue={...ue,props:{...ue.props,label:ae,value:le,children:de}}),ue}),V=vue.computed(()=>{var de,pe,ue,he,Ce,_e,xe;const ae=n.column.search;return["datetimerange","daterange","monthrange"].includes((de=ae==null?void 0:ae.props)==null?void 0:de.type)||(pe=ae==null?void 0:ae.props)!=null&&pe.isRange?{rangeSeparator:((ue=ae==null?void 0:ae.props)==null?void 0:ue.rangeSeparator)??"-",startPlaceholder:((he=ae==null?void 0:ae.props)==null?void 0:he.startPlaceholder)??"开始时间",endPlaceholder:((Ce=ae==null?void 0:ae.props)==null?void 0:Ce.endPlaceholder)??"结束时间"}:{placeholder:((_e=ae==null?void 0:ae.props)==null?void 0:_e.placeholder)??((xe=ae==null?void 0:ae.el)!=null&&xe.includes("input")?"请输入":"请选择")}}),z=vue.computed(()=>{var ue,he;const ae=n.column.search,le=i.value[(ae==null?void 0:ae.key)??handleProp(n.column.prop)],de=ae==null?void 0:ae.el,pe=(ue=ae==null?void 0:ae.props)==null?void 0:ue.placeholder;if(ae!=null&&ae.width)if(isFunction$2(ae==null?void 0:ae.width)){if(ae==null?void 0:ae.width(le))return(ae==null?void 0:ae.width(le))+"px"}else return(ae==null?void 0:ae.width)+"px";if(le&&le.length!==0&&["select","select-v2","tree-select","cascader"].includes(de||"")){if(isArray$2(le)){let xe=L.value;const Ie=[];if(le.forEach(Oe=>{const $e=xe.find(Pt=>Pt[g.value.value]===Oe);Ie.push($e?$e[g.value.label]:Oe);const qe=$e[g.value.children]??L.value;xe=$e?qe:[]}),(he=ae==null?void 0:ae.props)!=null&&he.multiple){const qe=getWidthByText(Ie[0])+42;return le.length>1?qe+26+getWidthByText("+ "+(le.length-1))+"px":qe+"px"}return getWidthByText(Ie.join(" / "))+"px"}let Ce=L.value.find(xe=>xe[g.value.value]===le);const _e=Ce?Ce[g.value.label]:le;return getWidthByText(_e)+"px"}else return pe?getWidthByText(pe)+"px":"100px"}),j=vue.computed(()=>{var ae,le,de,pe,ue;return(de=(le=(ae=n.column)==null?void 0:ae.search)==null?void 0:le.props)!=null&&de.multiple&&((ue=(pe=n.column)==null?void 0:pe.search)==null?void 0:ue.el)==="select"?{collapseTags:!0,collapseTagsTooltip:!0}:{}}),oe=vue.computed(()=>{var le;const ae=n.column.search;return((le=ae==null?void 0:ae.props)==null?void 0:le.clearable)??((ae==null?void 0:ae.defaultValue)==null||!1)}),re=ae=>{var le,de,pe,ue,he,Ce,_e,xe,Ie;if(((pe=(de=(le=n.column)==null?void 0:le.search)==null?void 0:de.props)==null?void 0:pe.type)==="daterange"){const{searchParam:Oe}=vue.toRefs(n);if(ae!=null&&ae.length){const $e=((Ce=(he=(ue=n.column)==null?void 0:ue.search)==null?void 0:he.props)==null?void 0:Ce.beginTime)||"beginTime",qe=((Ie=(xe=(_e=n.column)==null?void 0:_e.search)==null?void 0:xe.props)==null?void 0:Ie.endTime)||"endTime";Oe.value[$e]=ae[0],Oe.value[qe]=ae[1]}else delete Oe.value.beginTime,delete Oe.value.endTime}(ae==null||ae==="")&&r("search"),ae instanceof Array&&!ae.length&&r("search")},ie=()=>{var ae;["input","input-number"].includes(((ae=n.column.search)==null?void 0:ae.el)||"")&&r("search")};return(ae,le)=>{var de,pe,ue,he,Ce,_e,xe;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(((de=ae.column.search)==null?void 0:de.render)??`el-${(pe=ae.column.search)==null?void 0:pe.el}`),vue.mergeProps({...$.value,...V.value,searchParam:i.value,clearable:oe.value,...j.value},{modelValue:i.value[((ue=ae.column.search)==null?void 0:ue.key)??vue.unref(handleProp)(ae.column.prop)],"onUpdate:modelValue":le[0]||(le[0]=Ie=>{var Oe;return i.value[((Oe=ae.column.search)==null?void 0:Oe.key)??vue.unref(handleProp)(ae.column.prop)]=Ie}),modelModifiers:{trim:!0},data:((he=ae.column.search)==null?void 0:he.el)==="tree-select"?k.value:[],options:L.value,"prefix-icon":(_e=(Ce=ae.column.search)==null?void 0:Ce.props)==null?void 0:_e.prefixIcon,onChange:re,onKeyup:vue.withKeys(ie,["enter"])}),vue.createSlots({default:vue.withCtx(()=>{var Ie;return[((Ie=ae.column.search)==null?void 0:Ie.el)==="select"?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(k.value,(Oe,$e)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("el-option"),{key:$e,label:Oe[g.value.label]??"",value:Oe[g.value.value]},null,8,["label","value"]))),128)):vue.renderSlot(ae.$slots,"default",{key:1},void 0,!0)]}),_:2},[((xe=ae.column.search)==null?void 0:xe.el)==="cascader"?{name:"default",fn:vue.withCtx(({data:Ie})=>[vue.createElementVNode("span",null,vue.toDisplayString(Ie[g.value.label]),1)]),key:"0"}:void 0]),1040,["modelValue","data","options","prefix-icon"]))])}}}),SearchFormItem=_export_sfc(_sfc_main$6,[["__scopeId","data-v-e6e10dd4"]]),_hoisted_1$4={class:"table-search"},_hoisted_2$3={key:0},_hoisted_3$3={key:0,class:"operation"},_sfc_main$5=vue.defineComponent({name:"SearchForm",__name:"SearchForm",props:{columns:{default:()=>[]},searchParam:{default:()=>({})},search:{},reset:{},isShowResetBtn:{type:Boolean,default:!0},isShowSearchBtn:{type:Boolean,default:!0}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElForm),{ref:"formRef",model:n.searchParam,class:"table-search--left",onSubmit:r[0]||(r[0]=vue.withModifiers(()=>{},["prevent"]))},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},void 0,!0),n.columns.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.columns,i=>{var g,y,k;return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:i.prop},[!vue.unref(isBoolean$1)((g=i.search)==null?void 0:g.isShow)||(y=i.search)!=null&&y.isShow?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[vue.createVNode(vue.unref(ElFormItem),null,vue.createSlots({default:vue.withCtx(()=>[vue.createVNode(SearchFormItem,{column:i,"search-param":n.searchParam,onSearch:n.search},null,8,["column","search-param","onSearch"])]),_:2},[(k=i.search)!=null&&k.label?{name:"label",fn:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSpace),{size:4},{default:vue.withCtx(()=>{var L,$;return[vue.createElementVNode("span",null,vue.toDisplayString(`${i.search.label}`),1),(L=i.search)!=null&&L.tooltip?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,effect:"dark",content:($=i.search)==null?void 0:$.tooltip,placement:"top"},{default:vue.withCtx(()=>r[1]||(r[1]=[vue.createElementVNode("i",{class:vue.normalizeClass("iconfont icon-yiwen")},null,-1)])),_:2},1032,["content"])):vue.createCommentVNode("",!0)]}),_:2},1024),r[2]||(r[2]=vue.createElementVNode("span",null,":",-1))]),key:"0"}:void 0]),1024)])):vue.createCommentVNode("",!0)],64)}),128)),e.isShowSearchBtn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",class:"table-search--search-btn",onClick:n.search},{icon:vue.withCtx(()=>r[3]||(r[3]=[vue.createElementVNode("i",{class:"ztable-iconfont icon-zhihao-table-search"},null,-1)])),default:vue.withCtx(()=>[r[4]||(r[4]=vue.createTextVNode(" 搜索 "))]),_:1},8,["onClick"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0)]),_:3},8,["model"]),e.isShowResetBtn&&n.columns.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$3,[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"light",content:"重置",placement:"top"},{default:vue.withCtx(()=>{var i;return[n.columns.length>1||((i=n.columns[0].search)==null?void 0:i.el)!=="input"?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,class:"table-search--reset-btn",onClick:n.reset},{icon:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(refresh_left_default))]),_:1})]),_:1},8,["onClick"])):vue.createCommentVNode("",!0)]}),_:1})])):vue.createCommentVNode("",!0)]))}}),SearchForm=_export_sfc(_sfc_main$5,[["__scopeId","data-v-6c482a18"]]),_hoisted_1$3={class:"el-pagination__total zh-page-total"},_sfc_main$4=vue.defineComponent({name:"Pagination",__name:"tablePagination",props:{pageable:{},handleSizeChange:{type:Function},handleCurrentChange:{type:Function}},setup(t){return(e,n)=>e.pageable.total?(vue.openBlock(),vue.createBlock(vue.unref(ElPagination),{key:0,class:"zh-pagination",background:!0,"current-page":e.pageable.page,"page-size":e.pageable.size,total:e.pageable.total,layout:"slot, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"zhPaginationLeftSlot",{pageable:e.pageable},()=>[vue.createElementVNode("div",_hoisted_1$3,"共"+vue.toDisplayString(e.pageable.total)+"条数据",1)],!0)]),_:3},8,["current-page","page-size","total","onSizeChange","onCurrentChange"])):vue.createCommentVNode("",!0)}}),TablePagination=_export_sfc(_sfc_main$4,[["__scopeId","data-v-26dd9888"]]);function _isSlot(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vue.isVNode(t)}const _sfc_main$3=vue.defineComponent({name:"TableColumn",__name:"TableColumn",props:{column:{},customColumn:{type:Boolean}},setup(t){const e=t,n=vue.ref(e.column),r=vue.useSlots(),i=vue.inject("enumMap",vue.ref(new Map)),g=(L,$)=>i.value.get(L.prop)&&L.isFilterEnum?filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames):formatValue(handleRowAccordingToProp($.row,L.prop)),y=(L,$)=>filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames,"tag"),k=L=>vue.createVNode(vue.Fragment,null,[L.isShow&&vue.createVNode(ElTableColumn,vue.mergeProps(L,{"class-name":L.wrap&&"table-column--wrap",showOverflowTooltip:L.showOverflowTooltip??L.prop!=="operation"}),{default:$=>{var z,j,oe;let V;if(L._children)return L._children.map(re=>k(re));if(L.render)return L.render($);if(L.prop==="operation"){if(!r[handleProp(L.prop)]){n.value.width=0;return}const re=((j=(z=r[handleProp(L.prop)]($))==null?void 0:z.at(0))==null?void 0:j.children)||[],ie=_e=>Array.from(_e).map(xe=>{var Ie,Oe;return((Ie=xe.type)==null?void 0:Ie.name)==="ElButton"&&xe.children!=="v-if"?xe:(Oe=xe.children)!=null&&Oe.length?ie(xe.children):null}).filter(Boolean).flat(),ae=ie(re),le=_e=>{let xe="";return _e.forEach(Ie=>{xe+=Ie.children.default()[0].children}),getWidthByText(xe,14)+16*(_e.length>0?_e.length-1:0)},de=_e=>{n.value.hasOperationMaxWidth||(n.value.width=0,n.value.hasOperationMaxWidth=!0);const xe=n.value.width;let Ie=0;_e>0&&(Ie=Math.round(_e)+32),Ie>Number.parseInt((xe==null?void 0:xe.toString())||"0")&&(n.value.width=Ie,n.value.hasOperationMaxWidth=!0)};if(ae.length<=3||L.expandOperationButtons){const _e=Math.ceil(le(ae));let xe=_e;return e.customColumn&&(xe=ae.length?ae.length===1?_e+30:_e:50),de(xe),vue.createVNode("div",{class:"operation-container all-action"},[r[handleProp(L.prop)]($)])}const pe=[],ue=ae.slice(0,2),he=vue.createVNode(ElButton,{link:!0,type:"primary"},{default:()=>[vue.createTextVNode("更多")]});pe.push(...ue),pe[3]=vue.createVNode(ElDropdown,null,{default:()=>he,dropdown:()=>{let _e;return vue.createVNode(ElDropdownMenu,null,_isSlot(_e=ae.slice(2).map(xe=>vue.createVNode(ElDropdownItem,null,_isSlot(xe)?xe:{default:()=>[xe]})))?_e:{default:()=>[_e]})}});const Ce=le([...ue,he]);return de(Ce),vue.createVNode("div",{class:"operation-container"},[pe])}return r[handleProp(L.prop)]?r[handleProp(L.prop)]($):L.tag?vue.createVNode(ElTag,{type:y(L,$)},_isSlot(V=g(L,$))?V:{default:()=>[V]}):L.click&&g(L,$)!==DEFAULT_VALUE$1?vue.createVNode("span",{class:"el-link el-link--primary scan-link",onClick:function(){L.click($==null?void 0:$.row,$==null?void 0:$.$index)}},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)]):vue.createVNode("span",{class:((oe=filterEnumObj(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop)))==null?void 0:oe.state)||"text"},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)])},header:$=>L.headerRender?L.headerRender($):r[`${handleProp(L.prop)}Header`]?r[`${handleProp(L.prop)}Header`]($):L.label})]);return(L,$)=>(vue.openBlock(),vue.createBlock(k,vue.normalizeProps(vue.guardReactiveProps(n.value)),null,16))}}),_hoisted_1$2={class:"custom-column-dialog"},_hoisted_2$2={class:"table-body"},_hoisted_3$2={class:"name"},_hoisted_4$1={key:0,class:"ml-10"},_hoisted_5$1={class:"custom-width-label text"},_hoisted_6$1={key:0,class:"custom-width-input-box"},_hoisted_7$1={class:"custom-column-footer"},_hoisted_8$1={class:"flex-1"},_sfc_main$2=vue.defineComponent({name:"ColSetting",__name:"ColSetting",props:{originTableColumns:{default:()=>[]}},emits:["close","submit","dragSort"],setup(t,{expose:e,emit:n}){const r=vue.ref(),i=vue.ref(!1),g=t,y=vue.ref([]),k=vue.ref(new Date().getTime()),L=vue.ref(!1),$=vue.ref(),V=le=>{y.value=le,L.value=!0,vue.nextTick(()=>{re()})},z=le=>{i.value=le},j=n,oe=async()=>{j("submit",y.value),L.value=!1},re=()=>{$.value&&($.value.destroy(),k.value=new Date().getTime(),r.value.doLayout()),vue.nextTick(()=>{const le=document.querySelector(".custom-column-dialog tbody");$.value=Sortable.create(le,{handle:".move",animation:300,filter:".operation",onEnd({newIndex:de,oldIndex:pe}){if(!de&&de!==0||!pe&&pe!==0)return;let ue=cloneDeep(y.value);const he=ue[pe];if(de<pe)for(let Ce=de;Ce<pe;Ce++)ue[Ce].order=String(Number(ue[Ce].order)+1);else for(let Ce=pe+1;Ce<=de;Ce++)ue[Ce].order=String(Number(ue[Ce].order)-1);he.order=String(de),y.value=cloneDeep(ue)}})})},ie=()=>{const le=cloneDeep(g.originTableColumns);i.value?y.value=le:y.value=y.value.map(de=>{const pe=y.value.find(ue=>ue.prop===de.prop);return!(pe!=null&&pe.isShow)||pe.prop==="operation"?de:le.find(ue=>ue.prop===de.prop)}),re()},ae=()=>{L.value=!1};return e({openColSetting:V}),(le,de)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createVNode(_sfc_main$s,{modelValue:L.value,"onUpdate:modelValue":de[1]||(de[1]=pe=>L.value=pe),size:"middle"},{header:vue.withCtx(()=>de[2]||(de[2]=[vue.createElementVNode("div",{class:"title"},"自定义列",-1),vue.createElementVNode("div",{class:"sub-title"},"勾选需要展示的列,拖动列名进行排序",-1)])),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:i.value,"onUpdate:modelValue":de[0]||(de[0]=pe=>i.value=pe),class:"checkbox",label:"全局",onChange:z},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_8$1,[vue.createVNode(ZhButton$1,{plain:"",onClick:ae},{default:vue.withCtx(()=>de[4]||(de[4]=[vue.createTextVNode("取消")])),_:1}),vue.createVNode(ZhButton$1,{plain:"",class:"w-auto",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.value?"全局恢复默认":"恢复默认"),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",onClick:oe},{default:vue.withCtx(()=>de[5]||(de[5]=[vue.createTextVNode("保存")])),_:1})])])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[(vue.openBlock(),vue.createBlock(vue.unref(ElTable),{ref_key:"tableRef",ref:r,class:"custom-colum-table",key:k.value,data:y.value,"row-class-name":pe=>pe.row.prop==="operation"?"operation":""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{width:"100",label:"选择"},{default:vue.withCtx(({row:pe})=>[vue.createVNode(vue.unref(ElCheckbox),{class:"custom-column-check",modelValue:pe.isShow,"onUpdate:modelValue":ue=>pe.isShow=ue,disabled:pe.readonly},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"label",label:"名称"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),pe.readonly?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$1,"(必选)")):vue.createCommentVNode("",!0),pe.prop!=="operation"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:"move move-icon"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(rank_default))]),_:1})):vue.createCommentVNode("",!0)])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"width",label:"宽度",width:"180"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",{class:vue.normalizeClass(`custom-width-box ${pe.readonly&&"readonly"}`)},[de[3]||(de[3]=vue.createElementVNode("span",{class:"text"},"宽度",-1)),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(pe.width)+" px",1),pe.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:pe.width,"onUpdate:modelValue":ue=>pe.width=ue,class:"custom-width-input",min:10,max:1e3,controls:!1},null,8,["modelValue","onUpdate:modelValue"])]))],2)]),_:1})]),_:1},8,["data","row-class-name"]))])]),_:1},8,["modelValue"])]))}}),ColSetting=_export_sfc(_sfc_main$2,[["__scopeId","data-v-fd937235"]]),_hoisted_1$1={class:"no-card table-main zh-table"},_hoisted_2$1={class:"table-title-container"},_hoisted_3$1={key:0,class:"table-title"},_hoisted_4={key:1,class:"table-header-tip"},_hoisted_5={class:"table-header-container"},_hoisted_6={key:0,class:"table-header"},_hoisted_7={class:"header-button-ri"},_hoisted_8={key:0},_hoisted_9={class:"table-body-container"},_hoisted_10={class:"text d-flex inline-input-text pointer"},_hoisted_11={key:1,class:"inline-input-box d-flex"},_hoisted_12={class:"table-empty"},_hoisted_13=["src"],_sfc_main$1=vue.defineComponent({name:"ZhTable",__name:"Table",props:{columns:{default:()=>[]},data:{},requestApi:{},requestAuto:{type:Boolean,default:!0},requestError:{type:Function,default:t=>{console.error("protable中请求数据错误",t)}},handleParam:{},dataCallback:{},selectChangeCallback:{},title:{},pagination:{type:Boolean,default:!0},initParam:{default:{}},border:{type:Boolean,default:!1},rowKey:{default:"id"},isShowSearch:{type:Boolean,default:!0},maxHeight:{},isShowSearchBtn:{type:Boolean,default:!0},isShowResetBtn:{type:Boolean,default:!0},customColumn:{type:Boolean,default:!1},onSortChange:{},offset:{},customColumnCacheKey:{},customColumnPageCacheKey:{},beforeReset:{}},emits:["search","reset","dargSort"],setup(t,{expose:e,emit:n}){var Un;const r=vue.ref(new Date().getTime()),i={mounted(xn){var On;(On=xn.querySelector("input"))==null||On.focus()}},g=vue.useSlots(),y=t,k=vue.ref(),L=["selection","radio","index","expand","sort","input"],$=vue.ref(y.isShowSearch),V=vue.ref(""),z=vue.ref({}),j=vue.ref(y.maxHeight||"1000px"),{selectionChange:oe,selectedList:re,selectedListIds:ie,isSelected:ae}=useSelection(y.rowKey,y.selectChangeCallback),{loading:le,tableData:de,pageable:pe,searchParam:ue,searchInitParam:he,getTableList:Ce,search:_e,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe}=useTable(y.requestApi,y.initParam,y.pagination,y.dataCallback,y.requestError,y.handleParam),$e=xn=>{function On(er){return er.replace(/[A-Z]/g,ar=>"_"+ar.toLowerCase())}const Ln={ascending:"asc",descending:"desc"},{prop:_n,order:Mn}=xn,Wn=On(handleProp(_n)),Qn=Ln[Mn];ue.value={...ue.value,sortKey:Wn,sortOrder:Qn},pe.value.page=1,_e()},qe=()=>k.value.clearSelection(),Pt=()=>k.value.clearSort(),Lt=vue.ref(!1),Ve=()=>{En(),y.customColumn&&Zn(),y.requestAuto&&Ce(),y.data&&(pe.value.total=y.data.length)};vue.onMounted(()=>{Ve(),vue.nextTick(()=>{Lt.value=!0})}),vue.onActivated(()=>{Lt.value&&Ve()}),vue.onDeactivated(()=>{}),vue.onUnmounted(()=>{});const Fe=vue.computed(()=>y.data?y.pagination?y.data.slice((pe.value.page-1)*pe.value.size,pe.value.size*pe.value.page):y.data:de.value),ze=xn=>{pe.value.total=xn};vue.watch(()=>y.initParam,Ce,{deep:!0});let Ue=vue.reactive(y.columns);const Ne=vue.computed(()=>hn(Ue)),Et=vue.ref(new Map),kt=async({prop:xn,enum:On})=>{if(!On||Et.value.has(xn)&&(typeof On=="function"||Et.value.get(xn)===On))return;if(typeof On!="function")return Et.value.set(xn,vue.unref(On));Et.value.set(xn,[]);const{data:Ln}=await On();Et.value.set(xn,Ln)};vue.provide("enumMap",Et);const hn=(xn,On=[])=>(xn.forEach(async Ln=>{var _n;(_n=Ln._children)!=null&&_n.length&&On.push(...hn(Ln._children)),On.push(Ln),Ln.isShow=Ln.isShow??!0,Ln.isFilterEnum=Ln.isFilterEnum??!0,await kt(Ln)}),On.filter(Ln=>{var _n;return!((_n=Ln._children)!=null&&_n.length)})),Dt=vue.computed(()=>{var xn;return(xn=Ne.value)==null?void 0:xn.filter(On=>{var Ln,_n;return((Ln=On.search)==null?void 0:Ln.el)||((_n=On.search)==null?void 0:_n.render)}).sort((On,Ln)=>On.search.order-Ln.search.order)});(Un=Dt.value)==null||Un.forEach((xn,On)=>{var Mn,Wn,Qn;xn.search.order=((Mn=xn.search)==null?void 0:Mn.order)??On+2;const Ln=((Wn=xn.search)==null?void 0:Wn.key)??handleProp(xn.prop),_n=(Qn=xn.search)==null?void 0:Qn.defaultValue;_n!=null&&(he.value[Ln]=_n,ue.value[Ln]=_n)});const jt=n,Tn=()=>{var xn;(xn=k.value)==null||xn.clearSelection(),_e(),jt("search")},kn=()=>{y.beforeReset&&y.beforeReset(),xe(),Pt(),jt("reset")},En=()=>{const xn=document.querySelector(".el-table__body-wrapper tbody");xn&&Sortable.create(xn,{handle:".move",animation:300,onEnd({newIndex:On,oldIndex:Ln}){const[_n]=Fe.value.splice(Ln,1);Fe.value.splice(On,0,_n),jt("dargSort",{newIndex:On,oldIndex:Ln})}})},Cn=vue.ref(0),In=(xn,On)=>{const Ln=de.value.findIndex(_n=>_n.$showInput);Ln>-1&&(de.value[Ln]=cloneDeep(z.value),de.value[Ln].$showInput=!1),Cn.value=$get(xn,String(On)),xn.$showInput=!0,z.value=cloneDeep(xn)},An=async(xn,On,Ln)=>{set$2(xn,On,Cn.value),Ln&&await Ln(xn),xn.$showInput=!1,ElMessage.success("更新成功"),await Ce()},Nn=async xn=>{const On=de.value.findIndex(Ln=>isEqual(pickBy$1(Ln,identity$1),pickBy$1(xn,identity$1)));On>-1&&(de.value[On]=cloneDeep(z.value),de.value[On].$showInput=!1)},Vn=useColSetting(y.customColumnCacheKey),Bn=vue.ref(null),Yn=()=>Ue.map((xn,On)=>({readonly:xn.isCustomDisable||["id","operation"].includes(String(xn.prop)),order:On,index:On,width:xn.width||xn.minWidth,...xn})).sort((xn,On)=>{const Ln=Number(xn.order),_n=Number(On.order);return Ln-_n}),Xn=()=>{zn=vue.reactive(Yn()),vue.nextTick(()=>{Bn.value.openColSetting(cloneDeep(zn))})},Zn=()=>{if(!y.customColumnPageCacheKey)return;const xn=Vn.getColumnCache(y.customColumnPageCacheKey);if(xn!=null&&xn.length){const On=Ue.map(Ln=>{const _n=xn.find(Mn=>Mn.prop===Ln.prop);if(_n){const Mn={...Ln,order:_n.order||Ln.order,isShow:_n.isShow!==void 0?_n.isShow:Ln.isShow,readonly:_n.readonly!==void 0?_n.readonly:Ln.readonly,prop:_n.prop||Ln.prop,index:_n.index||Ln.index};return Ln.minWidth&&(Mn.minWidth=_n.minWidth||Ln.minWidth),Ln.width&&(Mn.width=_n.width||Ln.width),Mn}return Ln});zn=vue.reactive(On),Ue=vue.reactive(zn)}};let zn=vue.reactive(Yn());const jn=cloneDeep(Yn()),$n=xn=>{if(!y.customColumnPageCacheKey)return console.error("请添加自定义列缓存配置项:customColumnPageCacheKey");xn=xn.map(On=>{const Ln=jn.find(_n=>_n.prop===On.prop);return Ln&&Ln.minWidth&&(On.minWidth=On.width,delete On.width),On}),Ue=vue.reactive(cloneDeep(xn)),Vn.setColumnCache(y.customColumnPageCacheKey,xn),r.value=new Date().getTime(),k.value.doLayout()};return e({element:k,tableData:Fe,radio:V,pageable:pe,searchParam:ue,searchInitParam:he,setPageTotal:ze,getTableList:Ce,search:_e,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe,clearSelection:qe,enumMap:Et,isSelected:ae,selectedList:re,selectedListIds:ie}),(xn,On)=>{const Ln=vue.resolveDirective("loading");return vue.openBlock(),vue.createBlock(vue.unref(ElConfigProvider),{locale:vue.unref(zhCn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[xn.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,vue.toDisplayString(xn.title),1)):vue.createCommentVNode("",!0),vue.unref(g).headerTip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.renderSlot(xn.$slots,"headerTip",{},void 0,!0)])):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",_hoisted_5,[vue.withDirectives(vue.createVNode(SearchForm,{search:Tn,reset:kn,columns:Dt.value,"search-param":vue.unref(ue),"is-show-reset-btn":y.isShowResetBtn,"is-show-search-btn":y.isShowSearchBtn},{default:vue.withCtx(()=>[xn.$slots.tableHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6,[vue.createElementVNode("div",_hoisted_7,[vue.renderSlot(xn.$slots,"tableHeader",{selectedList:vue.unref(re),selectedListIds:vue.unref(ie),isSelected:vue.unref(ae)},void 0,!0)])])):vue.createCommentVNode("",!0)]),_:3},8,["columns","search-param","is-show-reset-btn","is-show-search-btn"]),[[vue.vShow,$.value]])]),vue.unref(g).searchBarBottom?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8,[vue.renderSlot(xn.$slots,"searchBarBottom",{},void 0,!0)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9,[y.customColumn?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"col-setting-button",onClick:Xn},[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:"自定义列",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14,color:"#000000a6"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(setting_default))]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.mergeProps({ref_key:"tableRef",ref:k},xn.$attrs,{key:r.value,data:Fe.value,border:xn.border,"row-key":xn.rowKey,"max-height":j.value,"row-style":{height:"42px"},"tooltip-effect":"light","tooltip-options":{showArrow:!1,placement:"bottom-start",offset:y.offset?y.offset:-20}},vue.toHandlers(xn.$attrs),{onSelectionChange:vue.unref(oe),onSortChange:On[1]||(On[1]=_n=>y.onSortChange?y.onSortChange(_n):$e(_n))}),{append:vue.withCtx(()=>[vue.renderSlot(xn.$slots,"append",{},void 0,!0)]),empty:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.renderSlot(xn.$slots,"empty",{},()=>[vue.createElementVNode("img",{src:`${vue.unref(CDN_URL$1)}ghy-components/empty.png`,class:"zh-empty-img",alt:"notData"},null,8,_hoisted_13),On[5]||(On[5]=vue.createElementVNode("div",null,"暂无数据",-1))],!0)])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(Ue).sort((_n,Mn)=>_n.order-Mn.order),_n=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_n},[_n.type&&L.includes(_n.type)&&_n.isShow?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:0,ref_for:!0},_n,{align:_n.align??"left","reserve-selection":_n.type=="selection"}),vue.createSlots({default:vue.withCtx(Mn=>[_n.type=="expand"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_n.render?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.render),vue.mergeProps({key:0,ref_for:!0},Mn),null,16)):vue.renderSlot(xn.$slots,_n.type,vue.mergeProps({key:1,ref_for:!0},Mn),void 0,!0)],64)):vue.createCommentVNode("",!0),_n.type=="sort"?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,class:"move"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(d_caret_default))]),_:1})]),_:1})):vue.createCommentVNode("",!0),_n.type=="input"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[Mn.row.$showInput?(vue.openBlock(),vue.createElementBlock("div",_hoisted_11,[vue.withDirectives(vue.createVNode(vue.unref(ElInputNumber),{modelValue:Cn.value,"onUpdate:modelValue":On[0]||(On[0]=Wn=>Cn.value=Wn),min:0,controls:!1},null,8,["modelValue"]),[[i]]),vue.createVNode(vue.unref(ElLink),{underline:!1,type:"primary",onClick:Wn=>An(Mn.row,String(_n.prop),_n.blurCallback),class:"ml-5"},{default:vue.withCtx(()=>On[3]||(On[3]=[vue.createTextVNode(" 保存 ")])),_:2},1032,["onClick"]),vue.createVNode(vue.unref(ElLink),{type:"primary",underline:!1,onClick:Wn=>Nn(Mn.row),class:"ml-5"},{default:vue.withCtx(()=>On[4]||(On[4]=[vue.createTextVNode(" 取消 ")])),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:"编辑",placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_10,[vue.createTextVNode(vue.toDisplayString(vue.unref($get)(Mn.row,String(_n.prop)))+" ",1),vue.createVNode(vue.unref(ElLink),{underline:!1,class:"text d-flex inline-input-text pointer",onClick:Wn=>In(Mn.row,_n.prop)},{default:vue.withCtx(()=>On[2]||(On[2]=[vue.createElementVNode("i",{class:"iconfont icon-edit"},null,-1)])),_:2},1032,["onClick"])])]),_:2},1024))],64)):vue.createCommentVNode("",!0)]),_:2},[_n.headerRender?{name:"header",fn:vue.withCtx(Mn=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.headerRender),vue.mergeProps({ref_for:!0},Mn),null,16))]),key:"0"}:void 0]),1040,["align","reserve-selection"])):vue.createCommentVNode("",!0),!_n.type&&_n.prop&&_n.isShow?(vue.openBlock(),vue.createBlock(_sfc_main$3,{key:1,column:_n,"custom-column":xn.customColumn},vue.createSlots({_:2},[vue.renderList(Object.keys(xn.$slots),Mn=>({name:Mn,fn:vue.withCtx(Wn=>[vue.renderSlot(xn.$slots,Mn,vue.mergeProps({ref_for:!0},Wn),void 0,!0)])}))]),1032,["column","custom-column"])):vue.createCommentVNode("",!0)],64))),128))]),_:3},16,["data","border","row-key","max-height","tooltip-options","onSelectionChange"])),[[Ln,vue.unref(le)]])]),vue.renderSlot(xn.$slots,"pagination",{},()=>[xn.pagination?(vue.openBlock(),vue.createBlock(TablePagination,{key:0,pageable:vue.unref(pe),"handle-size-change":vue.unref(Ie),"handle-current-change":vue.unref(Oe)},{zhPaginationLeftSlot:vue.withCtx(_n=>[vue.renderSlot(xn.$slots,"zhPaginationLeft",vue.normalizeProps(vue.guardReactiveProps(_n)),void 0,!0)]),_:3},8,["pageable","handle-size-change","handle-current-change"])):vue.createCommentVNode("",!0)],!0)]),y.customColumn?(vue.openBlock(),vue.createBlock(ColSetting,{key:0,ref_key:"colRef",ref:Bn,"origin-table-columns":vue.unref(jn),onSubmit:$n},null,8,["origin-table-columns"])):vue.createCommentVNode("",!0)]),_:3},8,["locale"])}}}),Table=_export_sfc(_sfc_main$1,[["__scopeId","data-v-83e26bf1"]]),ZhTable=withInstall$1(Table),_hoisted_1={key:1},_hoisted_2={key:1,class:"zh-base-item--value--file"},_hoisted_3={key:2},_sfc_main=vue.defineComponent({name:"ZhBaseItem",__name:"BaseItem",props:{label:{},labelRender:{},colon:{type:Boolean,default:!1},value:{},fileId:{},rewriteFileName:{},valueRender:{},onClick:{},labelWidth:{},infoDirection:{default:"horizontal"},defaultValue:{default:DEFAULT_VALUE$1},className:{},labelClassName:{},valueClassName:{},span:{default:1},showFileName:{type:Boolean,default:!0},fetchFileById:{}},setup(t){const e=vue.useSlots(),n=t,r=vue.inject("infoLabelWidth",void 0),i=vue.computed(()=>!!(n.onClick&&n.value)),g=vue.computed(()=>!!(!n.value&&n.fileId)),y=vue.ref(),k=vue.computed(()=>{var j;const z=(j=y.value)==null?void 0:j.name;if(!z)return"";if(n.rewriteFileName){const oe=z.substring(z.lastIndexOf("."));return n.rewriteFileName+oe}return z}),L=vue.computed(()=>{const z={},j=n.labelWidth||r;return j&&n.infoDirection==="horizontal"&&(isNaN(Number(j))?z.width=j:z.width=j+"px"),z}),$=vue.computed(()=>({...L.value})),V=vue.computed(()=>n.value===""?DEFAULT_VALUE$1:n.value??DEFAULT_VALUE$1);return vue.watchEffect(async()=>{!g.value||!n.fileId||!n.fetchFileById||(y.value=await n.fetchFileById(n.fileId))}),(z,j)=>(vue.openBlock(),vue.createBlock(vue.unref(ZhGridItem),{span:z.span,label:z.label},{default:vue.withCtx(oe=>{var re;return[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item",[z.infoDirection,z.className]])},[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-label",[z.infoDirection,z.labelClassName]]),style:vue.normalizeStyle({width:z.infoDirection==="horizontal"&&oe.maxLabelWidthInCol?oe.maxLabelWidthInCol+"px":void 0,...$.value})},[z.labelRender?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.labelRender),{key:0})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_1,vue.toDisplayString(z.label)+vue.toDisplayString(z.colon?":":""),1))],6),vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-value",z.valueClassName])},[vue.unref(e).value?vue.renderSlot(z.$slots,"value",{key:0,content:z.value}):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[i.value?(vue.openBlock(),vue.createBlock(vue.unref(ElLink),{key:0,type:"primary",onClick:j[0]||(j[0]=vue.withModifiers(ie=>z.onClick&&z.onClick(z.value),["stop"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(z.value),1)]),_:1})):g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[z.showFileName?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(ElIcon),{class:"iconfont"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1}),vue.createTextVNode(" "+vue.toDisplayString(k.value),1)],64)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElLink),{type:"primary",href:(re=y.value)==null?void 0:re.path,target:"_blank",class:vue.normalizeClass({"ml-8":z.showFileName})},{default:vue.withCtx(()=>j[1]||(j[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href","class"])])):z.valueRender?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.valueRender)))])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:3},[vue.createTextVNode(vue.toDisplayString(V.value),1)],64))],64))],2)],2)]}),_:3},8,["span","label"]))}}),ZhBaseItem=withInstall$1(_sfc_main),components=[ZhBaseInfo,ZhButton,ZhDatePicker,ZhDetailHeader,ZhDetailSubTitle,ZhDialog,ZhDiyDataTable,ZhEditInfoPair,ZhFileWrapper,ZhGrid,ZhGridItem,ZhMultiGrid,ZhInfoPair,ZhInput,ZhInputNumber,ZhLoading,ZhMessageBox,ZhConfirm,ZhAlert,ZhPrompt,ZhMoneyInput,ZhPageHeadPanel,ZhToolTips,ZhMap,ZhButtonGroup,ZhTable],installer=makeInstaller(components);exports.CDN_URL=CDN_URL,exports.DEFAULT_VALUE=DEFAULT_VALUE,exports.DIY_DATA_TYPE=DIY_DATA_TYPE,exports.LOG_DATE_FORMAT=LOG_DATE_FORMAT,exports.ZhAlert=ZhAlert,exports.ZhBaseInfo=ZhBaseInfo,exports.ZhBaseItem=ZhBaseItem,exports.ZhButton=ZhButton,exports.ZhButtonGroup=ZhButtonGroup,exports.ZhConfirm=ZhConfirm,exports.ZhDatePicker=ZhDatePicker,exports.ZhDetailHeader=ZhDetailHeader,exports.ZhDetailSubTitle=ZhDetailSubTitle,exports.ZhDialog=ZhDialog,exports.ZhDiyDataTable=ZhDiyDataTable,exports.ZhEditInfoPair=ZhEditInfoPair,exports.ZhFileWrapper=ZhFileWrapper,exports.ZhGrid=ZhGrid,exports.ZhGridItem=ZhGridItem,exports.ZhInfoPair=ZhInfoPair,exports.ZhInput=ZhInput,exports.ZhInputNumber=ZhInputNumber,exports.ZhLoading=ZhLoading,exports.ZhMap=ZhMap,exports.ZhMessageBox=ZhMessageBox,exports.ZhMoneyInput=ZhMoneyInput,exports.ZhMultiGrid=ZhMultiGrid,exports.ZhPageHeadPanel=ZhPageHeadPanel,exports.ZhPrompt=ZhPrompt,exports.ZhTable=ZhTable,exports.ZhToolTips=ZhToolTips,exports.baseMap=baseMap,exports.default=installer,exports.mapDefaultCenter=mapDefaultCenter,exports.mapZoom=mapZoom,exports.projection=projection,exports.renderShipsLimit=renderShipsLimit,exports.tiandituKey=tiandituKey,exports.zhongkeKey=zhongkeKey,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
707
+ */function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function _objectSpread2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(r){_defineProperty(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _typeof(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function(e){return typeof e}:_typeof=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _extends(){return _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},_extends.apply(this,arguments)}function _objectWithoutPropertiesLoose(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,g;for(g=0;g<r.length;g++)i=r[g],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function _objectWithoutProperties(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose(t,e),r,i;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(i=0;i<g.length;i++)r=g[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var version="1.15.6";function userAgent(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var IE11OrLess=userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Edge=userAgent(/Edge/i),FireFox=userAgent(/firefox/i),Safari=userAgent(/safari/i)&&!userAgent(/chrome/i)&&!userAgent(/android/i),IOS=userAgent(/iP(ad|od|hone)/i),ChromeForAndroid=userAgent(/chrome/i)&&userAgent(/android/i),captureMode={capture:!1,passive:!1};function on(t,e,n){t.addEventListener(e,n,!IE11OrLess&&captureMode)}function off(t,e,n){t.removeEventListener(e,n,!IE11OrLess&&captureMode)}function matches(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function getParentOrHost(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function closest(t,e,n,r){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&matches(t,e):matches(t,e))||r&&t===n)return t;if(t===n)break}while(t=getParentOrHost(t))}return null}var R_SPACE=/\s+/g;function toggleClass(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(R_SPACE," ").replace(" "+e+" "," ");t.className=(r+(n?" "+e:"")).replace(R_SPACE," ")}}function css(t,e,n){var r=t&&t.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=n+(typeof n=="string"?"":"px")}}function matrix(t,e){var n="";if(typeof t=="string")n=t;else do{var r=css(t,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function find(t,e,n){if(t){var r=t.getElementsByTagName(e),i=0,g=r.length;if(n)for(;i<g;i++)n(r[i],i);return r}return[]}function getWindowScrollingElement(){var t=document.scrollingElement;return t||document.documentElement}function getRect(t,e,n,r,i){if(!(!t.getBoundingClientRect&&t!==window)){var g,y,k,L,$,V,z;if(t!==window&&t.parentNode&&t!==getWindowScrollingElement()?(g=t.getBoundingClientRect(),y=g.top,k=g.left,L=g.bottom,$=g.right,V=g.height,z=g.width):(y=0,k=0,L=window.innerHeight,$=window.innerWidth,V=window.innerHeight,z=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!IE11OrLess))do if(i&&i.getBoundingClientRect&&(css(i,"transform")!=="none"||n&&css(i,"position")!=="static")){var j=i.getBoundingClientRect();y-=j.top+parseInt(css(i,"border-top-width")),k-=j.left+parseInt(css(i,"border-left-width")),L=y+g.height,$=k+g.width;break}while(i=i.parentNode);if(r&&t!==window){var oe=matrix(i||t),re=oe&&oe.a,ie=oe&&oe.d;oe&&(y/=ie,k/=re,z/=re,V/=ie,L=y+V,$=k+z)}return{top:y,left:k,bottom:L,right:$,width:z,height:V}}}function isScrolledPast(t,e,n){for(var r=getParentAutoScrollElement(t,!0),i=getRect(t)[e];r;){var g=getRect(r)[n],y=void 0;if(y=i>=g,!y)return r;if(r===getWindowScrollingElement())break;r=getParentAutoScrollElement(r,!1)}return!1}function getChild(t,e,n,r){for(var i=0,g=0,y=t.children;g<y.length;){if(y[g].style.display!=="none"&&y[g]!==Sortable.ghost&&(r||y[g]!==Sortable.dragged)&&closest(y[g],n.draggable,t,!1)){if(i===e)return y[g];i++}g++}return null}function lastChild(t,e){for(var n=t.lastElementChild;n&&(n===Sortable.ghost||css(n,"display")==="none"||e&&!matches(n,e));)n=n.previousElementSibling;return n||null}function index(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)t.nodeName.toUpperCase()!=="TEMPLATE"&&t!==Sortable.clone&&(!e||matches(t,e))&&n++;return n}function getRelativeScrollOffset(t){var e=0,n=0,r=getWindowScrollingElement();if(t)do{var i=matrix(t),g=i.a,y=i.d;e+=t.scrollLeft*g,n+=t.scrollTop*y}while(t!==r&&(t=t.parentNode));return[e,n]}function indexOfObject(t,e){for(var n in t)if(t.hasOwnProperty(n)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t[n][r])return Number(n)}return-1}function getParentAutoScrollElement(t,e){if(!t||!t.getBoundingClientRect)return getWindowScrollingElement();var n=t,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=css(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return getWindowScrollingElement();if(r||e)return n;r=!0}}while(n=n.parentNode);return getWindowScrollingElement()}function extend(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function isRectEqual(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}var _throttleTimeout;function throttle(t,e){return function(){if(!_throttleTimeout){var n=arguments,r=this;n.length===1?t.call(r,n[0]):t.apply(r,n),_throttleTimeout=setTimeout(function(){_throttleTimeout=void 0},e)}}}function cancelThrottle(){clearTimeout(_throttleTimeout),_throttleTimeout=void 0}function scrollBy(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function clone(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function getChildContainingRectFromElement(t,e,n){var r={};return Array.from(t.children).forEach(function(i){var g,y,k,L;if(!(!closest(i,e.draggable,t,!1)||i.animated||i===n)){var $=getRect(i);r.left=Math.min((g=r.left)!==null&&g!==void 0?g:1/0,$.left),r.top=Math.min((y=r.top)!==null&&y!==void 0?y:1/0,$.top),r.right=Math.max((k=r.right)!==null&&k!==void 0?k:-1/0,$.right),r.bottom=Math.max((L=r.bottom)!==null&&L!==void 0?L:-1/0,$.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var expando="Sortable"+new Date().getTime();function AnimationStateManager(){var t=[],e;return{captureAnimationState:function(){if(t=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(i){if(!(css(i,"display")==="none"||i===Sortable.ghost)){t.push({target:i,rect:getRect(i)});var g=_objectSpread2({},t[t.length-1].rect);if(i.thisAnimationDuration){var y=matrix(i,!0);y&&(g.top-=y.f,g.left-=y.e)}i.fromRect=g}})}},addAnimationState:function(r){t.push(r)},removeAnimationState:function(r){t.splice(indexOfObject(t,{target:r}),1)},animateAll:function(r){var i=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var g=!1,y=0;t.forEach(function(k){var L=0,$=k.target,V=$.fromRect,z=getRect($),j=$.prevFromRect,oe=$.prevToRect,re=k.rect,ie=matrix($,!0);ie&&(z.top-=ie.f,z.left-=ie.e),$.toRect=z,$.thisAnimationDuration&&isRectEqual(j,z)&&!isRectEqual(V,z)&&(re.top-z.top)/(re.left-z.left)===(V.top-z.top)/(V.left-z.left)&&(L=calculateRealTime(re,j,oe,i.options)),isRectEqual(z,V)||($.prevFromRect=V,$.prevToRect=z,L||(L=i.options.animation),i.animate($,re,z,L)),L&&(g=!0,y=Math.max(y,L),clearTimeout($.animationResetTimer),$.animationResetTimer=setTimeout(function(){$.animationTime=0,$.prevFromRect=null,$.fromRect=null,$.prevToRect=null,$.thisAnimationDuration=null},L),$.thisAnimationDuration=L)}),clearTimeout(e),g?e=setTimeout(function(){typeof r=="function"&&r()},y):typeof r=="function"&&r(),t=[]},animate:function(r,i,g,y){if(y){css(r,"transition",""),css(r,"transform","");var k=matrix(this.el),L=k&&k.a,$=k&&k.d,V=(i.left-g.left)/(L||1),z=(i.top-g.top)/($||1);r.animatingX=!!V,r.animatingY=!!z,css(r,"transform","translate3d("+V+"px,"+z+"px,0)"),this.forRepaintDummy=repaint(r),css(r,"transition","transform "+y+"ms"+(this.options.easing?" "+this.options.easing:"")),css(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){css(r,"transition",""),css(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},y)}}}}function repaint(t){return t.offsetWidth}function calculateRealTime(t,e,n,r){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*r.animation}var plugins=[],defaults={initializeByDefault:!0},PluginManager={mount:function t(e){for(var n in defaults)defaults.hasOwnProperty(n)&&!(n in e)&&(e[n]=defaults[n]);plugins.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),plugins.push(e)},pluginEvent:function t(e,n,r){var i=this;this.eventCanceled=!1,r.cancel=function(){i.eventCanceled=!0};var g=e+"Global";plugins.forEach(function(y){n[y.pluginName]&&(n[y.pluginName][g]&&n[y.pluginName][g](_objectSpread2({sortable:n},r)),n.options[y.pluginName]&&n[y.pluginName][e]&&n[y.pluginName][e](_objectSpread2({sortable:n},r)))})},initializePlugins:function t(e,n,r,i){plugins.forEach(function(k){var L=k.pluginName;if(!(!e.options[L]&&!k.initializeByDefault)){var $=new k(e,n,e.options);$.sortable=e,$.options=e.options,e[L]=$,_extends(r,$.defaults)}});for(var g in e.options)if(e.options.hasOwnProperty(g)){var y=this.modifyOption(e,g,e.options[g]);typeof y<"u"&&(e.options[g]=y)}},getEventProperties:function t(e,n){var r={};return plugins.forEach(function(i){typeof i.eventProperties=="function"&&_extends(r,i.eventProperties.call(n[i.pluginName],e))}),r},modifyOption:function t(e,n,r){var i;return plugins.forEach(function(g){e[g.pluginName]&&g.optionListeners&&typeof g.optionListeners[n]=="function"&&(i=g.optionListeners[n].call(e[g.pluginName],r))}),i}};function dispatchEvent(t){var e=t.sortable,n=t.rootEl,r=t.name,i=t.targetEl,g=t.cloneEl,y=t.toEl,k=t.fromEl,L=t.oldIndex,$=t.newIndex,V=t.oldDraggableIndex,z=t.newDraggableIndex,j=t.originalEvent,oe=t.putSortable,re=t.extraEventProperties;if(e=e||n&&n[expando],!!e){var ie,ae=e.options,le="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!IE11OrLess&&!Edge?ie=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(ie=document.createEvent("Event"),ie.initEvent(r,!0,!0)),ie.to=y||n,ie.from=k||n,ie.item=i||n,ie.clone=g,ie.oldIndex=L,ie.newIndex=$,ie.oldDraggableIndex=V,ie.newDraggableIndex=z,ie.originalEvent=j,ie.pullMode=oe?oe.lastPutMode:void 0;var de=_objectSpread2(_objectSpread2({},re),PluginManager.getEventProperties(r,e));for(var pe in de)ie[pe]=de[pe];n&&n.dispatchEvent(ie),ae[le]&&ae[le].call(e,ie)}}var _excluded=["evt"],pluginEvent=function t(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.evt,g=_objectWithoutProperties(r,_excluded);PluginManager.pluginEvent.bind(Sortable)(e,n,_objectSpread2({dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,dragStarted:moved,putSortable,activeSortable:Sortable.active,originalEvent:i,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex,hideGhostForTarget:_hideGhostForTarget,unhideGhostForTarget:_unhideGhostForTarget,cloneNowHidden:function(){cloneHidden=!0},cloneNowShown:function(){cloneHidden=!1},dispatchSortableEvent:function(k){_dispatchEvent({sortable:n,name:k,originalEvent:i})}},g))};function _dispatchEvent(t){dispatchEvent(_objectSpread2({putSortable,cloneEl,targetEl:dragEl,rootEl,oldIndex,oldDraggableIndex,newIndex,newDraggableIndex},t))}var dragEl,parentEl,ghostEl,rootEl,nextEl,lastDownEl,cloneEl,cloneHidden,oldIndex,newIndex,oldDraggableIndex,newDraggableIndex,activeGroup,putSortable,awaitingDragStarted=!1,ignoreNextClick=!1,sortables=[],tapEvt,touchEvt,lastDx,lastDy,tapDistanceLeft,tapDistanceTop,moved,lastTarget,lastDirection,pastFirstInvertThresh=!1,isCircumstantialInvert=!1,targetMoveDistance,ghostRelativeParent,ghostRelativeParentInitialScroll=[],_silent=!1,savedInputChecked=[],documentExists=typeof document<"u",PositionGhostAbsolutely=IOS,CSSFloatProperty=Edge||IE11OrLess?"cssFloat":"float",supportDraggable=documentExists&&!ChromeForAndroid&&!IOS&&"draggable"in document.createElement("div"),supportCssPointerEvents=function(){if(documentExists){if(IE11OrLess)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),_detectDirection=function t(e,n){var r=css(e),i=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),g=getChild(e,0,n),y=getChild(e,1,n),k=g&&css(g),L=y&&css(y),$=k&&parseInt(k.marginLeft)+parseInt(k.marginRight)+getRect(g).width,V=L&&parseInt(L.marginLeft)+parseInt(L.marginRight)+getRect(y).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(g&&k.float&&k.float!=="none"){var z=k.float==="left"?"left":"right";return y&&(L.clear==="both"||L.clear===z)?"vertical":"horizontal"}return g&&(k.display==="block"||k.display==="flex"||k.display==="table"||k.display==="grid"||$>=i&&r[CSSFloatProperty]==="none"||y&&r[CSSFloatProperty]==="none"&&$+V>i)?"vertical":"horizontal"},_dragElInRowColumn=function t(e,n,r){var i=r?e.left:e.top,g=r?e.right:e.bottom,y=r?e.width:e.height,k=r?n.left:n.top,L=r?n.right:n.bottom,$=r?n.width:n.height;return i===k||g===L||i+y/2===k+$/2},_detectNearestEmptySortable=function t(e,n){var r;return sortables.some(function(i){var g=i[expando].options.emptyInsertThreshold;if(!(!g||lastChild(i))){var y=getRect(i),k=e>=y.left-g&&e<=y.right+g,L=n>=y.top-g&&n<=y.bottom+g;if(k&&L)return r=i}}),r},_prepareGroup=function t(e){function n(g,y){return function(k,L,$,V){var z=k.options.group.name&&L.options.group.name&&k.options.group.name===L.options.group.name;if(g==null&&(y||z))return!0;if(g==null||g===!1)return!1;if(y&&g==="clone")return g;if(typeof g=="function")return n(g(k,L,$,V),y)(k,L,$,V);var j=(y?k:L).options.group.name;return g===!0||typeof g=="string"&&g===j||g.join&&g.indexOf(j)>-1}}var r={},i=e.group;(!i||_typeof(i)!="object")&&(i={name:i}),r.name=i.name,r.checkPull=n(i.pull,!0),r.checkPut=n(i.put),r.revertClone=i.revertClone,e.group=r},_hideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","none")},_unhideGhostForTarget=function t(){!supportCssPointerEvents&&ghostEl&&css(ghostEl,"display","")};documentExists&&!ChromeForAndroid&&document.addEventListener("click",function(t){if(ignoreNextClick)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ignoreNextClick=!1,!1},!0);var nearestEmptyInsertDetectEvent=function t(e){if(dragEl){e=e.touches?e.touches[0]:e;var n=_detectNearestEmptySortable(e.clientX,e.clientY);if(n){var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[expando]._onDragOver(r)}}},_checkOutsideTargetEl=function t(e){dragEl&&dragEl.parentNode[expando]._isOutsideThisEl(e.target)};function Sortable(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=_extends({},e),t[expando]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return _detectDirection(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(y,k){y.setData("Text",k.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Sortable.supportPointer!==!1&&"PointerEvent"in window&&(!Safari||IOS),emptyInsertThreshold:5};PluginManager.initializePlugins(this,t,n);for(var r in n)!(r in e)&&(e[r]=n[r]);_prepareGroup(e);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=e.forceFallback?!1:supportDraggable,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?on(t,"pointerdown",this._onTapStart):(on(t,"mousedown",this._onTapStart),on(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(on(t,"dragover",this),on(t,"dragenter",this)),sortables.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),_extends(this,AnimationStateManager())}Sortable.prototype={constructor:Sortable,_isOutsideThisEl:function t(e){!this.el.contains(e)&&e!==this.el&&(lastTarget=null)},_getDirection:function t(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,dragEl):this.options.direction},_onTapStart:function t(e){if(e.cancelable){var n=this,r=this.el,i=this.options,g=i.preventOnFilter,y=e.type,k=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,L=(k||e).target,$=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||L,V=i.filter;if(_saveInputCheckedState(r),!dragEl&&!(/mousedown|pointerdown/.test(y)&&e.button!==0||i.disabled)&&!$.isContentEditable&&!(!this.nativeDraggable&&Safari&&L&&L.tagName.toUpperCase()==="SELECT")&&(L=closest(L,i.draggable,r,!1),!(L&&L.animated)&&lastDownEl!==L)){if(oldIndex=index(L),oldDraggableIndex=index(L,i.draggable),typeof V=="function"){if(V.call(this,e,L,this)){_dispatchEvent({sortable:n,rootEl:$,name:"filter",targetEl:L,toEl:r,fromEl:r}),pluginEvent("filter",n,{evt:e}),g&&e.preventDefault();return}}else if(V&&(V=V.split(",").some(function(z){if(z=closest($,z.trim(),r,!1),z)return _dispatchEvent({sortable:n,rootEl:z,name:"filter",targetEl:L,fromEl:r,toEl:r}),pluginEvent("filter",n,{evt:e}),!0}),V)){g&&e.preventDefault();return}i.handle&&!closest($,i.handle,r,!1)||this._prepareDragStart(e,k,L)}}},_prepareDragStart:function t(e,n,r){var i=this,g=i.el,y=i.options,k=g.ownerDocument,L;if(r&&!dragEl&&r.parentNode===g){var $=getRect(r);if(rootEl=g,dragEl=r,parentEl=dragEl.parentNode,nextEl=dragEl.nextSibling,lastDownEl=r,activeGroup=y.group,Sortable.dragged=dragEl,tapEvt={target:dragEl,clientX:(n||e).clientX,clientY:(n||e).clientY},tapDistanceLeft=tapEvt.clientX-$.left,tapDistanceTop=tapEvt.clientY-$.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,dragEl.style["will-change"]="all",L=function(){if(pluginEvent("delayEnded",i,{evt:e}),Sortable.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!FireFox&&i.nativeDraggable&&(dragEl.draggable=!0),i._triggerDragStart(e,n),_dispatchEvent({sortable:i,name:"choose",originalEvent:e}),toggleClass(dragEl,y.chosenClass,!0)},y.ignore.split(",").forEach(function(V){find(dragEl,V.trim(),_disableDraggable)}),on(k,"dragover",nearestEmptyInsertDetectEvent),on(k,"mousemove",nearestEmptyInsertDetectEvent),on(k,"touchmove",nearestEmptyInsertDetectEvent),y.supportPointer?(on(k,"pointerup",i._onDrop),!this.nativeDraggable&&on(k,"pointercancel",i._onDrop)):(on(k,"mouseup",i._onDrop),on(k,"touchend",i._onDrop),on(k,"touchcancel",i._onDrop)),FireFox&&this.nativeDraggable&&(this.options.touchStartThreshold=4,dragEl.draggable=!0),pluginEvent("delayStart",this,{evt:e}),y.delay&&(!y.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Edge||IE11OrLess))){if(Sortable.eventCanceled){this._onDrop();return}y.supportPointer?(on(k,"pointerup",i._disableDelayedDrag),on(k,"pointercancel",i._disableDelayedDrag)):(on(k,"mouseup",i._disableDelayedDrag),on(k,"touchend",i._disableDelayedDrag),on(k,"touchcancel",i._disableDelayedDrag)),on(k,"mousemove",i._delayedDragTouchMoveHandler),on(k,"touchmove",i._delayedDragTouchMoveHandler),y.supportPointer&&on(k,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(L,y.delay)}else L()}},_delayedDragTouchMoveHandler:function t(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function t(){dragEl&&_disableDraggable(dragEl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._disableDelayedDrag),off(e,"touchend",this._disableDelayedDrag),off(e,"touchcancel",this._disableDelayedDrag),off(e,"pointerup",this._disableDelayedDrag),off(e,"pointercancel",this._disableDelayedDrag),off(e,"mousemove",this._delayedDragTouchMoveHandler),off(e,"touchmove",this._delayedDragTouchMoveHandler),off(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function t(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?on(document,"pointermove",this._onTouchMove):n?on(document,"touchmove",this._onTouchMove):on(document,"mousemove",this._onTouchMove):(on(dragEl,"dragend",this),on(rootEl,"dragstart",this._onDragStart));try{document.selection?_nextTick(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function t(e,n){if(awaitingDragStarted=!1,rootEl&&dragEl){pluginEvent("dragStarted",this,{evt:n}),this.nativeDraggable&&on(document,"dragover",_checkOutsideTargetEl);var r=this.options;!e&&toggleClass(dragEl,r.dragClass,!1),toggleClass(dragEl,r.ghostClass,!0),Sortable.active=this,e&&this._appendGhost(),_dispatchEvent({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function t(){if(touchEvt){this._lastX=touchEvt.clientX,this._lastY=touchEvt.clientY,_hideGhostForTarget();for(var e=document.elementFromPoint(touchEvt.clientX,touchEvt.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(touchEvt.clientX,touchEvt.clientY),e!==n);)n=e;if(dragEl.parentNode[expando]._isOutsideThisEl(e),n)do{if(n[expando]){var r=void 0;if(r=n[expando]._onDragOver({clientX:touchEvt.clientX,clientY:touchEvt.clientY,target:e,rootEl:n}),r&&!this.options.dragoverBubble)break}e=n}while(n=getParentOrHost(n));_unhideGhostForTarget()}},_onTouchMove:function t(e){if(tapEvt){var n=this.options,r=n.fallbackTolerance,i=n.fallbackOffset,g=e.touches?e.touches[0]:e,y=ghostEl&&matrix(ghostEl,!0),k=ghostEl&&y&&y.a,L=ghostEl&&y&&y.d,$=PositionGhostAbsolutely&&ghostRelativeParent&&getRelativeScrollOffset(ghostRelativeParent),V=(g.clientX-tapEvt.clientX+i.x)/(k||1)+($?$[0]-ghostRelativeParentInitialScroll[0]:0)/(k||1),z=(g.clientY-tapEvt.clientY+i.y)/(L||1)+($?$[1]-ghostRelativeParentInitialScroll[1]:0)/(L||1);if(!Sortable.active&&!awaitingDragStarted){if(r&&Math.max(Math.abs(g.clientX-this._lastX),Math.abs(g.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(ghostEl){y?(y.e+=V-(lastDx||0),y.f+=z-(lastDy||0)):y={a:1,b:0,c:0,d:1,e:V,f:z};var j="matrix(".concat(y.a,",").concat(y.b,",").concat(y.c,",").concat(y.d,",").concat(y.e,",").concat(y.f,")");css(ghostEl,"webkitTransform",j),css(ghostEl,"mozTransform",j),css(ghostEl,"msTransform",j),css(ghostEl,"transform",j),lastDx=V,lastDy=z,touchEvt=g}e.cancelable&&e.preventDefault()}},_appendGhost:function t(){if(!ghostEl){var e=this.options.fallbackOnBody?document.body:rootEl,n=getRect(dragEl,!0,PositionGhostAbsolutely,!0,e),r=this.options;if(PositionGhostAbsolutely){for(ghostRelativeParent=e;css(ghostRelativeParent,"position")==="static"&&css(ghostRelativeParent,"transform")==="none"&&ghostRelativeParent!==document;)ghostRelativeParent=ghostRelativeParent.parentNode;ghostRelativeParent!==document.body&&ghostRelativeParent!==document.documentElement?(ghostRelativeParent===document&&(ghostRelativeParent=getWindowScrollingElement()),n.top+=ghostRelativeParent.scrollTop,n.left+=ghostRelativeParent.scrollLeft):ghostRelativeParent=getWindowScrollingElement(),ghostRelativeParentInitialScroll=getRelativeScrollOffset(ghostRelativeParent)}ghostEl=dragEl.cloneNode(!0),toggleClass(ghostEl,r.ghostClass,!1),toggleClass(ghostEl,r.fallbackClass,!0),toggleClass(ghostEl,r.dragClass,!0),css(ghostEl,"transition",""),css(ghostEl,"transform",""),css(ghostEl,"box-sizing","border-box"),css(ghostEl,"margin",0),css(ghostEl,"top",n.top),css(ghostEl,"left",n.left),css(ghostEl,"width",n.width),css(ghostEl,"height",n.height),css(ghostEl,"opacity","0.8"),css(ghostEl,"position",PositionGhostAbsolutely?"absolute":"fixed"),css(ghostEl,"zIndex","100000"),css(ghostEl,"pointerEvents","none"),Sortable.ghost=ghostEl,e.appendChild(ghostEl),css(ghostEl,"transform-origin",tapDistanceLeft/parseInt(ghostEl.style.width)*100+"% "+tapDistanceTop/parseInt(ghostEl.style.height)*100+"%")}},_onDragStart:function t(e,n){var r=this,i=e.dataTransfer,g=r.options;if(pluginEvent("dragStart",this,{evt:e}),Sortable.eventCanceled){this._onDrop();return}pluginEvent("setupClone",this),Sortable.eventCanceled||(cloneEl=clone(dragEl),cloneEl.removeAttribute("id"),cloneEl.draggable=!1,cloneEl.style["will-change"]="",this._hideClone(),toggleClass(cloneEl,this.options.chosenClass,!1),Sortable.clone=cloneEl),r.cloneId=_nextTick(function(){pluginEvent("clone",r),!Sortable.eventCanceled&&(r.options.removeCloneOnHide||rootEl.insertBefore(cloneEl,dragEl),r._hideClone(),_dispatchEvent({sortable:r,name:"clone"}))}),!n&&toggleClass(dragEl,g.dragClass,!0),n?(ignoreNextClick=!0,r._loopId=setInterval(r._emulateDragOver,50)):(off(document,"mouseup",r._onDrop),off(document,"touchend",r._onDrop),off(document,"touchcancel",r._onDrop),i&&(i.effectAllowed="move",g.setData&&g.setData.call(r,i,dragEl)),on(document,"drop",r),css(dragEl,"transform","translateZ(0)")),awaitingDragStarted=!0,r._dragStartId=_nextTick(r._dragStarted.bind(r,n,e)),on(document,"selectstart",r),moved=!0,window.getSelection().removeAllRanges(),Safari&&css(document.body,"user-select","none")},_onDragOver:function t(e){var n=this.el,r=e.target,i,g,y,k=this.options,L=k.group,$=Sortable.active,V=activeGroup===L,z=k.sort,j=putSortable||$,oe,re=this,ie=!1;if(_silent)return;function ae(Ue,Ne){pluginEvent(Ue,re,_objectSpread2({evt:e,isOwner:V,axis:oe?"vertical":"horizontal",revert:y,dragRect:i,targetRect:g,canSort:z,fromSortable:j,target:r,completed:de,onMove:function(kt,hn){return _onMove(rootEl,n,dragEl,i,kt,getRect(kt),e,hn)},changed:pe},Ne))}function le(){ae("dragOverAnimationCapture"),re.captureAnimationState(),re!==j&&j.captureAnimationState()}function de(Ue){return ae("dragOverCompleted",{insertion:Ue}),Ue&&(V?$._hideClone():$._showClone(re),re!==j&&(toggleClass(dragEl,putSortable?putSortable.options.ghostClass:$.options.ghostClass,!1),toggleClass(dragEl,k.ghostClass,!0)),putSortable!==re&&re!==Sortable.active?putSortable=re:re===Sortable.active&&putSortable&&(putSortable=null),j===re&&(re._ignoreWhileAnimating=r),re.animateAll(function(){ae("dragOverAnimationComplete"),re._ignoreWhileAnimating=null}),re!==j&&(j.animateAll(),j._ignoreWhileAnimating=null)),(r===dragEl&&!dragEl.animated||r===n&&!r.animated)&&(lastTarget=null),!k.dragoverBubble&&!e.rootEl&&r!==document&&(dragEl.parentNode[expando]._isOutsideThisEl(e.target),!Ue&&nearestEmptyInsertDetectEvent(e)),!k.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),ie=!0}function pe(){newIndex=index(dragEl),newDraggableIndex=index(dragEl,k.draggable),_dispatchEvent({sortable:re,name:"change",toEl:n,newIndex,newDraggableIndex,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=closest(r,k.draggable,n,!0),ae("dragOver"),Sortable.eventCanceled)return ie;if(dragEl.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||re._ignoreWhileAnimating===r)return de(!1);if(ignoreNextClick=!1,$&&!k.disabled&&(V?z||(y=parentEl!==rootEl):putSortable===this||(this.lastPutMode=activeGroup.checkPull(this,$,dragEl,e))&&L.checkPut(this,$,dragEl,e))){if(oe=this._getDirection(e,r)==="vertical",i=getRect(dragEl),ae("dragOverValid"),Sortable.eventCanceled)return ie;if(y)return parentEl=rootEl,le(),this._hideClone(),ae("revert"),Sortable.eventCanceled||(nextEl?rootEl.insertBefore(dragEl,nextEl):rootEl.appendChild(dragEl)),de(!0);var ue=lastChild(n,k.draggable);if(!ue||_ghostIsLast(e,oe,this)&&!ue.animated){if(ue===dragEl)return de(!1);if(ue&&n===e.target&&(r=ue),r&&(g=getRect(r)),_onMove(rootEl,n,dragEl,i,r,g,e,!!r)!==!1)return le(),ue&&ue.nextSibling?n.insertBefore(dragEl,ue.nextSibling):n.appendChild(dragEl),parentEl=n,pe(),de(!0)}else if(ue&&_ghostIsFirst(e,oe,this)){var he=getChild(n,0,k,!0);if(he===dragEl)return de(!1);if(r=he,g=getRect(r),_onMove(rootEl,n,dragEl,i,r,g,e,!1)!==!1)return le(),n.insertBefore(dragEl,he),parentEl=n,pe(),de(!0)}else if(r.parentNode===n){g=getRect(r);var Ce=0,_e,xe=dragEl.parentNode!==n,Ie=!_dragElInRowColumn(dragEl.animated&&dragEl.toRect||i,r.animated&&r.toRect||g,oe),Oe=oe?"top":"left",$e=isScrolledPast(r,"top","top")||isScrolledPast(dragEl,"top","top"),qe=$e?$e.scrollTop:void 0;lastTarget!==r&&(_e=g[Oe],pastFirstInvertThresh=!1,isCircumstantialInvert=!Ie&&k.invertSwap||xe),Ce=_getSwapDirection(e,r,g,oe,Ie?1:k.swapThreshold,k.invertedSwapThreshold==null?k.swapThreshold:k.invertedSwapThreshold,isCircumstantialInvert,lastTarget===r);var Pt;if(Ce!==0){var Lt=index(dragEl);do Lt-=Ce,Pt=parentEl.children[Lt];while(Pt&&(css(Pt,"display")==="none"||Pt===ghostEl))}if(Ce===0||Pt===r)return de(!1);lastTarget=r,lastDirection=Ce;var Ve=r.nextElementSibling,Fe=!1;Fe=Ce===1;var ze=_onMove(rootEl,n,dragEl,i,r,g,e,Fe);if(ze!==!1)return(ze===1||ze===-1)&&(Fe=ze===1),_silent=!0,setTimeout(_unsilent,30),le(),Fe&&!Ve?n.appendChild(dragEl):r.parentNode.insertBefore(dragEl,Fe?Ve:r),$e&&scrollBy($e,0,qe-$e.scrollTop),parentEl=dragEl.parentNode,_e!==void 0&&!isCircumstantialInvert&&(targetMoveDistance=Math.abs(_e-getRect(r)[Oe])),pe(),de(!0)}if(n.contains(dragEl))return de(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function t(){off(document,"mousemove",this._onTouchMove),off(document,"touchmove",this._onTouchMove),off(document,"pointermove",this._onTouchMove),off(document,"dragover",nearestEmptyInsertDetectEvent),off(document,"mousemove",nearestEmptyInsertDetectEvent),off(document,"touchmove",nearestEmptyInsertDetectEvent)},_offUpEvents:function t(){var e=this.el.ownerDocument;off(e,"mouseup",this._onDrop),off(e,"touchend",this._onDrop),off(e,"pointerup",this._onDrop),off(e,"pointercancel",this._onDrop),off(e,"touchcancel",this._onDrop),off(document,"selectstart",this)},_onDrop:function t(e){var n=this.el,r=this.options;if(newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),pluginEvent("drop",this,{evt:e}),parentEl=dragEl&&dragEl.parentNode,newIndex=index(dragEl),newDraggableIndex=index(dragEl,r.draggable),Sortable.eventCanceled){this._nulling();return}awaitingDragStarted=!1,isCircumstantialInvert=!1,pastFirstInvertThresh=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),_cancelNextTick(this.cloneId),_cancelNextTick(this._dragStartId),this.nativeDraggable&&(off(document,"drop",this),off(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Safari&&css(document.body,"user-select",""),css(dragEl,"transform",""),e&&(moved&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),ghostEl&&ghostEl.parentNode&&ghostEl.parentNode.removeChild(ghostEl),(rootEl===parentEl||putSortable&&putSortable.lastPutMode!=="clone")&&cloneEl&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),dragEl&&(this.nativeDraggable&&off(dragEl,"dragend",this),_disableDraggable(dragEl),dragEl.style["will-change"]="",moved&&!awaitingDragStarted&&toggleClass(dragEl,putSortable?putSortable.options.ghostClass:this.options.ghostClass,!1),toggleClass(dragEl,this.options.chosenClass,!1),_dispatchEvent({sortable:this,name:"unchoose",toEl:parentEl,newIndex:null,newDraggableIndex:null,originalEvent:e}),rootEl!==parentEl?(newIndex>=0&&(_dispatchEvent({rootEl:parentEl,name:"add",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"remove",toEl:parentEl,originalEvent:e}),_dispatchEvent({rootEl:parentEl,name:"sort",toEl:parentEl,fromEl:rootEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),putSortable&&putSortable.save()):newIndex!==oldIndex&&newIndex>=0&&(_dispatchEvent({sortable:this,name:"update",toEl:parentEl,originalEvent:e}),_dispatchEvent({sortable:this,name:"sort",toEl:parentEl,originalEvent:e})),Sortable.active&&((newIndex==null||newIndex===-1)&&(newIndex=oldIndex,newDraggableIndex=oldDraggableIndex),_dispatchEvent({sortable:this,name:"end",toEl:parentEl,originalEvent:e}),this.save()))),this._nulling()},_nulling:function t(){pluginEvent("nulling",this),rootEl=dragEl=parentEl=ghostEl=nextEl=cloneEl=lastDownEl=cloneHidden=tapEvt=touchEvt=moved=newIndex=newDraggableIndex=oldIndex=oldDraggableIndex=lastTarget=lastDirection=putSortable=activeGroup=Sortable.dragged=Sortable.ghost=Sortable.clone=Sortable.active=null,savedInputChecked.forEach(function(e){e.checked=!0}),savedInputChecked.length=lastDx=lastDy=0},handleEvent:function t(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":dragEl&&(this._onDragOver(e),_globalDragOver(e));break;case"selectstart":e.preventDefault();break}},toArray:function t(){for(var e=[],n,r=this.el.children,i=0,g=r.length,y=this.options;i<g;i++)n=r[i],closest(n,y.draggable,this.el,!1)&&e.push(n.getAttribute(y.dataIdAttr)||_generateId(n));return e},sort:function t(e,n){var r={},i=this.el;this.toArray().forEach(function(g,y){var k=i.children[y];closest(k,this.options.draggable,i,!1)&&(r[g]=k)},this),n&&this.captureAnimationState(),e.forEach(function(g){r[g]&&(i.removeChild(r[g]),i.appendChild(r[g]))}),n&&this.animateAll()},save:function t(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function t(e,n){return closest(e,n||this.options.draggable,this.el,!1)},option:function t(e,n){var r=this.options;if(n===void 0)return r[e];var i=PluginManager.modifyOption(this,e,n);typeof i<"u"?r[e]=i:r[e]=n,e==="group"&&_prepareGroup(r)},destroy:function t(){pluginEvent("destroy",this);var e=this.el;e[expando]=null,off(e,"mousedown",this._onTapStart),off(e,"touchstart",this._onTapStart),off(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(off(e,"dragover",this),off(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),sortables.splice(sortables.indexOf(this.el),1),this.el=e=null},_hideClone:function t(){if(!cloneHidden){if(pluginEvent("hideClone",this),Sortable.eventCanceled)return;css(cloneEl,"display","none"),this.options.removeCloneOnHide&&cloneEl.parentNode&&cloneEl.parentNode.removeChild(cloneEl),cloneHidden=!0}},_showClone:function t(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(cloneHidden){if(pluginEvent("showClone",this),Sortable.eventCanceled)return;dragEl.parentNode==rootEl&&!this.options.group.revertClone?rootEl.insertBefore(cloneEl,dragEl):nextEl?rootEl.insertBefore(cloneEl,nextEl):rootEl.appendChild(cloneEl),this.options.group.revertClone&&this.animate(dragEl,cloneEl),css(cloneEl,"display",""),cloneHidden=!1}}};function _globalDragOver(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}function _onMove(t,e,n,r,i,g,y,k){var L,$=t[expando],V=$.options.onMove,z;return window.CustomEvent&&!IE11OrLess&&!Edge?L=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(L=document.createEvent("Event"),L.initEvent("move",!0,!0)),L.to=e,L.from=t,L.dragged=n,L.draggedRect=r,L.related=i||e,L.relatedRect=g||getRect(e),L.willInsertAfter=k,L.originalEvent=y,t.dispatchEvent(L),V&&(z=V.call($,L,y)),z}function _disableDraggable(t){t.draggable=!1}function _unsilent(){_silent=!1}function _ghostIsFirst(t,e,n){var r=getRect(getChild(n.el,0,n.options,!0)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX<i.left-g||t.clientY<r.top&&t.clientX<r.right:t.clientY<i.top-g||t.clientY<r.bottom&&t.clientX<r.left}function _ghostIsLast(t,e,n){var r=getRect(lastChild(n.el,n.options.draggable)),i=getChildContainingRectFromElement(n.el,n.options,ghostEl),g=10;return e?t.clientX>i.right+g||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>i.bottom+g||t.clientX>r.right&&t.clientY>r.top}function _getSwapDirection(t,e,n,r,i,g,y,k){var L=r?t.clientY:t.clientX,$=r?n.height:n.width,V=r?n.top:n.left,z=r?n.bottom:n.right,j=!1;if(!y){if(k&&targetMoveDistance<$*i){if(!pastFirstInvertThresh&&(lastDirection===1?L>V+$*g/2:L<z-$*g/2)&&(pastFirstInvertThresh=!0),pastFirstInvertThresh)j=!0;else if(lastDirection===1?L<V+targetMoveDistance:L>z-targetMoveDistance)return-lastDirection}else if(L>V+$*(1-i)/2&&L<z-$*(1-i)/2)return _getInsertDirection(e)}return j=j||y,j&&(L<V+$*g/2||L>z-$*g/2)?L>V+$/2?1:-1:0}function _getInsertDirection(t){return index(dragEl)<index(t)?1:-1}function _generateId(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,r=0;n--;)r+=e.charCodeAt(n);return r.toString(36)}function _saveInputCheckedState(t){savedInputChecked.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var r=e[n];r.checked&&savedInputChecked.push(r)}}function _nextTick(t){return setTimeout(t,0)}function _cancelNextTick(t){return clearTimeout(t)}documentExists&&on(document,"touchmove",function(t){(Sortable.active||awaitingDragStarted)&&t.cancelable&&t.preventDefault()}),Sortable.utils={on,off,css,find,is:function t(e,n){return!!closest(e,n,e,!1)},extend,throttle,closest,toggleClass,clone,index,nextTick:_nextTick,cancelNextTick:_cancelNextTick,detectDirection:_detectDirection,getChild,expando},Sortable.get=function(t){return t[expando]},Sortable.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Sortable.utils=_objectSpread2(_objectSpread2({},Sortable.utils),r.utils)),PluginManager.mount(r)})},Sortable.create=function(t,e){return new Sortable(t,e)},Sortable.version=version;var autoScrolls=[],scrollEl,scrollRootEl,scrolling=!1,lastAutoScrollX,lastAutoScrollY,touchEvt$1,pointerElemChangedInterval;function AutoScrollPlugin(){function t(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return t.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?on(document,"dragover",this._handleAutoScroll):this.options.supportPointer?on(document,"pointermove",this._handleFallbackAutoScroll):r.touches?on(document,"touchmove",this._handleFallbackAutoScroll):on(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?off(document,"dragover",this._handleAutoScroll):(off(document,"pointermove",this._handleFallbackAutoScroll),off(document,"touchmove",this._handleFallbackAutoScroll),off(document,"mousemove",this._handleFallbackAutoScroll)),clearPointerElemChangedInterval(),clearAutoScrolls(),cancelThrottle()},nulling:function(){touchEvt$1=scrollRootEl=scrollEl=scrolling=pointerElemChangedInterval=lastAutoScrollX=lastAutoScrollY=null,autoScrolls.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var i=this,g=(n.touches?n.touches[0]:n).clientX,y=(n.touches?n.touches[0]:n).clientY,k=document.elementFromPoint(g,y);if(touchEvt$1=n,r||this.options.forceAutoScrollFallback||Edge||IE11OrLess||Safari){autoScroll(n,this.options,k,r);var L=getParentAutoScrollElement(k,!0);scrolling&&(!pointerElemChangedInterval||g!==lastAutoScrollX||y!==lastAutoScrollY)&&(pointerElemChangedInterval&&clearPointerElemChangedInterval(),pointerElemChangedInterval=setInterval(function(){var $=getParentAutoScrollElement(document.elementFromPoint(g,y),!0);$!==L&&(L=$,clearAutoScrolls()),autoScroll(n,i.options,$,r)},10),lastAutoScrollX=g,lastAutoScrollY=y)}else{if(!this.options.bubbleScroll||getParentAutoScrollElement(k,!0)===getWindowScrollingElement()){clearAutoScrolls();return}autoScroll(n,this.options,getParentAutoScrollElement(k,!1),!1)}}},_extends(t,{pluginName:"scroll",initializeByDefault:!0})}function clearAutoScrolls(){autoScrolls.forEach(function(t){clearInterval(t.pid)}),autoScrolls=[]}function clearPointerElemChangedInterval(){clearInterval(pointerElemChangedInterval)}var autoScroll=throttle(function(t,e,n,r){if(e.scroll){var i=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,y=e.scrollSensitivity,k=e.scrollSpeed,L=getWindowScrollingElement(),$=!1,V;scrollRootEl!==n&&(scrollRootEl=n,clearAutoScrolls(),scrollEl=e.scroll,V=e.scrollFn,scrollEl===!0&&(scrollEl=getParentAutoScrollElement(n,!0)));var z=0,j=scrollEl;do{var oe=j,re=getRect(oe),ie=re.top,ae=re.bottom,le=re.left,de=re.right,pe=re.width,ue=re.height,he=void 0,Ce=void 0,_e=oe.scrollWidth,xe=oe.scrollHeight,Ie=css(oe),Oe=oe.scrollLeft,$e=oe.scrollTop;oe===L?(he=pe<_e&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"||Ie.overflowX==="visible"),Ce=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"||Ie.overflowY==="visible")):(he=pe<_e&&(Ie.overflowX==="auto"||Ie.overflowX==="scroll"),Ce=ue<xe&&(Ie.overflowY==="auto"||Ie.overflowY==="scroll"));var qe=he&&(Math.abs(de-i)<=y&&Oe+pe<_e)-(Math.abs(le-i)<=y&&!!Oe),Pt=Ce&&(Math.abs(ae-g)<=y&&$e+ue<xe)-(Math.abs(ie-g)<=y&&!!$e);if(!autoScrolls[z])for(var Lt=0;Lt<=z;Lt++)autoScrolls[Lt]||(autoScrolls[Lt]={});(autoScrolls[z].vx!=qe||autoScrolls[z].vy!=Pt||autoScrolls[z].el!==oe)&&(autoScrolls[z].el=oe,autoScrolls[z].vx=qe,autoScrolls[z].vy=Pt,clearInterval(autoScrolls[z].pid),(qe!=0||Pt!=0)&&($=!0,autoScrolls[z].pid=setInterval((function(){r&&this.layer===0&&Sortable.active._onTouchMove(touchEvt$1);var Ve=autoScrolls[this.layer].vy?autoScrolls[this.layer].vy*k:0,Fe=autoScrolls[this.layer].vx?autoScrolls[this.layer].vx*k:0;typeof V=="function"&&V.call(Sortable.dragged.parentNode[expando],Fe,Ve,t,touchEvt$1,autoScrolls[this.layer].el)!=="continue"||scrollBy(autoScrolls[this.layer].el,Fe,Ve)}).bind({layer:z}),24))),z++}while(e.bubbleScroll&&j!==L&&(j=getParentAutoScrollElement(j,!1)));scrolling=$}},30),drop=function t(e){var n=e.originalEvent,r=e.putSortable,i=e.dragEl,g=e.activeSortable,y=e.dispatchSortableEvent,k=e.hideGhostForTarget,L=e.unhideGhostForTarget;if(n){var $=r||g;k();var V=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,z=document.elementFromPoint(V.clientX,V.clientY);L(),$&&!$.el.contains(z)&&(y("spill"),this.onSpill({dragEl:i,putSortable:r}))}};function Revert(){}Revert.prototype={startIndex:null,dragStart:function t(e){var n=e.oldDraggableIndex;this.startIndex=n},onSpill:function t(e){var n=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var i=getChild(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(n,i):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop},_extends(Revert,{pluginName:"revertOnSpill"});function Remove(){}Remove.prototype={onSpill:function t(e){var n=e.dragEl,r=e.putSortable,i=r||this.sortable;i.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),i.animateAll()},drop},_extends(Remove,{pluginName:"removeOnSpill"}),Sortable.mount(new AutoScrollPlugin),Sortable.mount(Remove,Revert);const useTable=(t,e={},n=!0,r,i,g=y=>y)=>{const y=vue.reactive({tableData:[],pageable:{page:1,size:10,total:0},searchParam:{},searchInitParam:{},totalParam:{},loading:!1}),k=vue.computed({get:()=>({page:y.pageable.page,size:y.pageable.size}),set:ie=>{console.log("我是分页更新之后的值",ie)}}),L=async()=>{if(y.loading=!0,!t){y.loading=!1;return}try{const ie=localStorage.getItem("MytaskGotoListPageQuery");if(ie){e={},y.totalParam={};const le=JSON.parse(ie);e={...e,...le},y.searchParam={...le}}Object.assign(y.totalParam,e,n?k.value:{});for(const le in y.searchParam)y.searchParam[le]===""&&delete y.searchParam[le];let ae=await t(g({...y.searchInitParam,...y.totalParam}));if(r&&(ae=await r(ae)),y.tableData=n?ae.list:ae,n){const{currentPage:le,pageSize:de,total:pe}=ae;V({page:le,size:de,total:pe})}}catch(ie){i&&i(ie)}finally{y.loading=!1}},$=()=>{y.totalParam={},y.searchInitParam={},e={};const ie={};for(const ae in y.searchParam)(y.searchParam[ae]||y.searchParam[ae]===!1||y.searchParam[ae]===0)&&(ie[ae]=y.searchParam[ae]);Object.assign(y.totalParam,ie,n?k.value:{})},V=ie=>{Object.assign(y.pageable,ie)},z=()=>{y.pageable.page=1,$(),L().then()},j=()=>{y.pageable.page=1,y.searchParam={...y.searchInitParam},$(),L().then()},oe=ie=>{y.pageable.page=1,y.pageable.size=ie,L().then()},re=ie=>{y.pageable.page=ie,L().then()};return{...vue.toRefs(y),getTableList:L,search:z,reset:j,handleSizeChange:oe,handleCurrentChange:re,updatedTotalParam:$}},useSelection=(t="id",e)=>{const n=vue.ref(!1),r=vue.ref([]),i=vue.computed(()=>{const y=[];return r.value.forEach(k=>y.push(get$5(k,t))),y});return{isSelected:n,selectedList:r,selectedListIds:i,selectionChange:y=>{y.length?n.value=!0:n.value=!1,r.value=y,e&&e(y)}}},_hoisted_1$5={class:"search-form-item"},_sfc_main$6=vue.defineComponent({name:"SearchFormItem",__name:"SearchFormItem",props:{column:{},searchParam:{}},emits:["search"],setup(t,{emit:e}){vue.useCssVars(ae=>({"054b42e2":z.value}));const n=t,r=e,i=vue.computed(()=>n.searchParam),g=vue.computed(()=>{var ae,le,de;return{label:((ae=n.column.fieldNames)==null?void 0:ae.label)??"label",value:((le=n.column.fieldNames)==null?void 0:le.value)??"value",children:((de=n.column.fieldNames)==null?void 0:de.children)??"children"}}),y=vue.inject("enumMap",vue.ref(new Map)),k=vue.computed(()=>{var le;let ae=y.value.get(n.column.prop);return ae?(((le=n.column.search)==null?void 0:le.el)==="select-v2"&&n.column.fieldNames&&(ae=ae.map(de=>({...de,label:de[g.value.label],value:de[g.value.value]}))),ae):[]}),L=vue.computed(()=>{var ae,le;return((le=(ae=n.column.search)==null?void 0:ae.props)==null?void 0:le.options)??k.value??[]}),$=vue.computed(()=>{var he,Ce;const ae=g.value.label,le=g.value.value,de=g.value.children,pe=(he=n.column.search)==null?void 0:he.el;let ue=((Ce=n.column.search)==null?void 0:Ce.props)??{};return pe==="tree-select"&&(ue={...ue,props:{...ue.props,label:ae,children:de},nodeKey:le}),pe==="cascader"&&(ue={...ue,props:{...ue.props,label:ae,value:le,children:de}}),ue}),V=vue.computed(()=>{var de,pe,ue,he,Ce,_e,xe;const ae=n.column.search;return["datetimerange","daterange","monthrange"].includes((de=ae==null?void 0:ae.props)==null?void 0:de.type)||(pe=ae==null?void 0:ae.props)!=null&&pe.isRange?{rangeSeparator:((ue=ae==null?void 0:ae.props)==null?void 0:ue.rangeSeparator)??"-",startPlaceholder:((he=ae==null?void 0:ae.props)==null?void 0:he.startPlaceholder)??"开始时间",endPlaceholder:((Ce=ae==null?void 0:ae.props)==null?void 0:Ce.endPlaceholder)??"结束时间"}:{placeholder:((_e=ae==null?void 0:ae.props)==null?void 0:_e.placeholder)??((xe=ae==null?void 0:ae.el)!=null&&xe.includes("input")?"请输入":"请选择")}}),z=vue.computed(()=>{var ue,he;const ae=n.column.search,le=i.value[(ae==null?void 0:ae.key)??handleProp(n.column.prop)],de=ae==null?void 0:ae.el,pe=(ue=ae==null?void 0:ae.props)==null?void 0:ue.placeholder;if(ae!=null&&ae.width)if(isFunction$2(ae==null?void 0:ae.width)){if(ae==null?void 0:ae.width(le))return(ae==null?void 0:ae.width(le))+"px"}else return(ae==null?void 0:ae.width)+"px";if(le&&le.length!==0&&["select","select-v2","tree-select","cascader"].includes(de||"")){if(isArray$2(le)){let xe=L.value;const Ie=[];if(le.forEach(Oe=>{const $e=xe.find(Pt=>Pt[g.value.value]===Oe);Ie.push($e?$e[g.value.label]:Oe);const qe=$e[g.value.children]??L.value;xe=$e?qe:[]}),(he=ae==null?void 0:ae.props)!=null&&he.multiple){const qe=getWidthByText(Ie[0])+42;return le.length>1?qe+26+getWidthByText("+ "+(le.length-1))+"px":qe+"px"}return getWidthByText(Ie.join(" / "))+"px"}let Ce=L.value.find(xe=>xe[g.value.value]===le);const _e=Ce?Ce[g.value.label]:le;return getWidthByText(_e)+"px"}else return pe?getWidthByText(pe)+"px":"100px"}),j=vue.computed(()=>{var ae,le,de,pe,ue;return(de=(le=(ae=n.column)==null?void 0:ae.search)==null?void 0:le.props)!=null&&de.multiple&&((ue=(pe=n.column)==null?void 0:pe.search)==null?void 0:ue.el)==="select"?{collapseTags:!0,collapseTagsTooltip:!0}:{}}),oe=vue.computed(()=>{var le;const ae=n.column.search;return((le=ae==null?void 0:ae.props)==null?void 0:le.clearable)??((ae==null?void 0:ae.defaultValue)==null||!1)}),re=ae=>{var le,de,pe,ue,he,Ce,_e,xe,Ie;if(((pe=(de=(le=n.column)==null?void 0:le.search)==null?void 0:de.props)==null?void 0:pe.type)==="daterange"){const{searchParam:Oe}=vue.toRefs(n);if(ae!=null&&ae.length){const $e=((Ce=(he=(ue=n.column)==null?void 0:ue.search)==null?void 0:he.props)==null?void 0:Ce.beginTime)||"beginTime",qe=((Ie=(xe=(_e=n.column)==null?void 0:_e.search)==null?void 0:xe.props)==null?void 0:Ie.endTime)||"endTime";Oe.value[$e]=ae[0],Oe.value[qe]=ae[1]}else delete Oe.value.beginTime,delete Oe.value.endTime}(ae==null||ae==="")&&r("search"),ae instanceof Array&&!ae.length&&r("search")},ie=()=>{var ae;["input","input-number"].includes(((ae=n.column.search)==null?void 0:ae.el)||"")&&r("search")};return(ae,le)=>{var de,pe,ue,he,Ce,_e,xe;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(((de=ae.column.search)==null?void 0:de.render)??`el-${(pe=ae.column.search)==null?void 0:pe.el}`),vue.mergeProps({...$.value,...V.value,searchParam:i.value,clearable:oe.value,...j.value},{modelValue:i.value[((ue=ae.column.search)==null?void 0:ue.key)??vue.unref(handleProp)(ae.column.prop)],"onUpdate:modelValue":le[0]||(le[0]=Ie=>{var Oe;return i.value[((Oe=ae.column.search)==null?void 0:Oe.key)??vue.unref(handleProp)(ae.column.prop)]=Ie}),modelModifiers:{trim:!0},data:((he=ae.column.search)==null?void 0:he.el)==="tree-select"?k.value:[],options:L.value,"prefix-icon":(_e=(Ce=ae.column.search)==null?void 0:Ce.props)==null?void 0:_e.prefixIcon,onChange:re,onKeyup:vue.withKeys(ie,["enter"])}),vue.createSlots({default:vue.withCtx(()=>{var Ie;return[((Ie=ae.column.search)==null?void 0:Ie.el)==="select"?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(k.value,(Oe,$e)=>(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent("el-option"),{key:$e,label:Oe[g.value.label]??"",value:Oe[g.value.value]},null,8,["label","value"]))),128)):vue.renderSlot(ae.$slots,"default",{key:1},void 0,!0)]}),_:2},[((xe=ae.column.search)==null?void 0:xe.el)==="cascader"?{name:"default",fn:vue.withCtx(({data:Ie})=>[vue.createElementVNode("span",null,vue.toDisplayString(Ie[g.value.label]),1)]),key:"0"}:void 0]),1040,["modelValue","data","options","prefix-icon"]))])}}}),SearchFormItem=_export_sfc(_sfc_main$6,[["__scopeId","data-v-e6e10dd4"]]),_hoisted_1$4={class:"table-search"},_hoisted_2$3={key:0},_hoisted_3$3={key:0,class:"operation"},_sfc_main$5=vue.defineComponent({name:"SearchForm",__name:"SearchForm",props:{columns:{default:()=>[]},searchParam:{default:()=>({})},search:{},reset:{},isShowResetBtn:{type:Boolean,default:!0},isShowSearchBtn:{type:Boolean,default:!0}},setup(t){const e=t;return(n,r)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElForm),{ref:"formRef",model:n.searchParam,class:"table-search--left",onSubmit:r[0]||(r[0]=vue.withModifiers(()=>{},["prevent"]))},{default:vue.withCtx(()=>[vue.renderSlot(n.$slots,"default",{},void 0,!0),n.columns.length?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.columns,i=>{var g,y,k;return vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:i.prop},[!vue.unref(isBoolean$1)((g=i.search)==null?void 0:g.isShow)||(y=i.search)!=null&&y.isShow?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2$3,[vue.createVNode(vue.unref(ElFormItem),null,vue.createSlots({default:vue.withCtx(()=>[vue.createVNode(SearchFormItem,{column:i,"search-param":n.searchParam,onSearch:n.search},null,8,["column","search-param","onSearch"])]),_:2},[(k=i.search)!=null&&k.label?{name:"label",fn:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSpace),{size:4},{default:vue.withCtx(()=>{var L,$;return[vue.createElementVNode("span",null,vue.toDisplayString(`${i.search.label}`),1),(L=i.search)!=null&&L.tooltip?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,effect:"dark",content:($=i.search)==null?void 0:$.tooltip,placement:"top"},{default:vue.withCtx(()=>r[1]||(r[1]=[vue.createElementVNode("i",{class:vue.normalizeClass("iconfont icon-yiwen")},null,-1)])),_:2},1032,["content"])):vue.createCommentVNode("",!0)]}),_:2},1024),r[2]||(r[2]=vue.createElementVNode("span",null,":",-1))]),key:"0"}:void 0]),1024)])):vue.createCommentVNode("",!0)],64)}),128)),e.isShowSearchBtn?(vue.openBlock(),vue.createBlock(vue.unref(ElButton),{key:0,type:"primary",class:"table-search--search-btn",onClick:n.search},{icon:vue.withCtx(()=>r[3]||(r[3]=[vue.createElementVNode("i",{class:"ztable-iconfont icon-zhihao-table-search"},null,-1)])),default:vue.withCtx(()=>[r[4]||(r[4]=vue.createTextVNode(" 搜索 "))]),_:1},8,["onClick"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0)]),_:3},8,["model"]),e.isShowResetBtn&&n.columns.length?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$3,[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"light",content:"重置",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{class:"table-search--reset-btn",onClick:n.reset},{icon:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(refresh_left_default))]),_:1})]),_:1},8,["onClick"])]),_:1})])):vue.createCommentVNode("",!0)]))}}),SearchForm=_export_sfc(_sfc_main$5,[["__scopeId","data-v-78af7c4d"]]),_hoisted_1$3={class:"el-pagination__total zh-page-total"},_sfc_main$4=vue.defineComponent({name:"Pagination",__name:"tablePagination",props:{pageable:{},handleSizeChange:{type:Function},handleCurrentChange:{type:Function}},setup(t){return(e,n)=>e.pageable.total?(vue.openBlock(),vue.createBlock(vue.unref(ElPagination),{key:0,class:"zh-pagination",background:!0,"current-page":e.pageable.page,"page-size":e.pageable.size,total:e.pageable.total,layout:"slot, sizes, prev, pager, next, jumper",onSizeChange:e.handleSizeChange,onCurrentChange:e.handleCurrentChange},{default:vue.withCtx(()=>[vue.renderSlot(e.$slots,"zhPaginationLeftSlot",{pageable:e.pageable},()=>[vue.createElementVNode("div",_hoisted_1$3,"共"+vue.toDisplayString(e.pageable.total)+"条数据",1)],!0)]),_:3},8,["current-page","page-size","total","onSizeChange","onCurrentChange"])):vue.createCommentVNode("",!0)}}),TablePagination=_export_sfc(_sfc_main$4,[["__scopeId","data-v-26dd9888"]]);function _isSlot(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!vue.isVNode(t)}const _sfc_main$3=vue.defineComponent({name:"TableColumn",__name:"TableColumn",props:{column:{},customColumn:{type:Boolean}},setup(t){const e=t,n=vue.ref(e.column),r=vue.useSlots(),i=vue.inject("enumMap",vue.ref(new Map)),g=(L,$)=>i.value.get(L.prop)&&L.isFilterEnum?filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames):formatValue(handleRowAccordingToProp($.row,L.prop)),y=(L,$)=>filterEnum(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop),L.fieldNames,"tag"),k=L=>vue.createVNode(vue.Fragment,null,[L.isShow&&vue.createVNode(ElTableColumn,vue.mergeProps(L,{"class-name":L.wrap&&"table-column--wrap",showOverflowTooltip:L.showOverflowTooltip??L.prop!=="operation"}),{default:$=>{var z,j,oe;let V;if(L._children)return L._children.map(re=>k(re));if(L.render)return L.render($);if(L.prop==="operation"){if(!r[handleProp(L.prop)]){n.value.width=0;return}const re=((j=(z=r[handleProp(L.prop)]($))==null?void 0:z.at(0))==null?void 0:j.children)||[],ie=_e=>Array.from(_e).map(xe=>{var Ie,Oe;return((Ie=xe.type)==null?void 0:Ie.name)==="ElButton"&&xe.children!=="v-if"?xe:(Oe=xe.children)!=null&&Oe.length?ie(xe.children):null}).filter(Boolean).flat(),ae=ie(re),le=_e=>{let xe="";return _e.forEach(Ie=>{xe+=Ie.children.default()[0].children}),getWidthByText(xe,14)+16*(_e.length>0?_e.length-1:0)},de=_e=>{n.value.hasOperationMaxWidth||(n.value.width=0,n.value.hasOperationMaxWidth=!0);const xe=n.value.width;let Ie=0;_e>0&&(Ie=Math.round(_e)+32),Ie>Number.parseInt((xe==null?void 0:xe.toString())||"0")&&(n.value.width=Ie,n.value.hasOperationMaxWidth=!0)};if(ae.length<=3||L.expandOperationButtons){const _e=Math.ceil(le(ae));let xe=_e;return e.customColumn&&(xe=ae.length?ae.length===1?_e+30:_e:50),de(xe),vue.createVNode("div",{class:"operation-container all-action"},[r[handleProp(L.prop)]($)])}const pe=[],ue=ae.slice(0,2),he=vue.createVNode(ElButton,{link:!0,type:"primary"},{default:()=>[vue.createTextVNode("更多")]});pe.push(...ue),pe[3]=vue.createVNode(ElDropdown,null,{default:()=>he,dropdown:()=>{let _e;return vue.createVNode(ElDropdownMenu,null,_isSlot(_e=ae.slice(2).map(xe=>vue.createVNode(ElDropdownItem,null,_isSlot(xe)?xe:{default:()=>[xe]})))?_e:{default:()=>[_e]})}});const Ce=le([...ue,he]);return de(Ce),vue.createVNode("div",{class:"operation-container"},[pe])}return r[handleProp(L.prop)]?r[handleProp(L.prop)]($):L.tag?vue.createVNode(ElTag,{type:y(L,$)},_isSlot(V=g(L,$))?V:{default:()=>[V]}):L.click&&g(L,$)!==DEFAULT_VALUE$1?vue.createVNode("span",{class:"el-link el-link--primary scan-link",onClick:function(){L.click($==null?void 0:$.row,$==null?void 0:$.$index)}},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)]):vue.createVNode("span",{class:((oe=filterEnumObj(handleRowAccordingToProp($.row,L.prop),i.value.get(L.prop)))==null?void 0:oe.state)||"text"},[L.formatter?L.formatter($.row,$.column,$.row[L.prop],$.$index):g(L,$)])},header:$=>L.headerRender?L.headerRender($):r[`${handleProp(L.prop)}Header`]?r[`${handleProp(L.prop)}Header`]($):L.label})]);return(L,$)=>(vue.openBlock(),vue.createBlock(k,vue.normalizeProps(vue.guardReactiveProps(n.value)),null,16))}}),_hoisted_1$2={class:"custom-column-dialog"},_hoisted_2$2={class:"table-body"},_hoisted_3$2={class:"name"},_hoisted_4$1={key:0,class:"ml-10"},_hoisted_5$1={class:"custom-width-label text"},_hoisted_6$1={key:0,class:"custom-width-input-box"},_hoisted_7$1={class:"custom-column-footer"},_hoisted_8$1={class:"flex-1"},_sfc_main$2=vue.defineComponent({name:"ColSetting",__name:"ColSetting",props:{originTableColumns:{default:()=>[]}},emits:["close","submit","dragSort"],setup(t,{expose:e,emit:n}){const r=vue.ref(),i=vue.ref(!1),g=t,y=vue.ref([]),k=vue.ref(new Date().getTime()),L=vue.ref(!1),$=vue.ref(),V=le=>{y.value=le,L.value=!0,vue.nextTick(()=>{re()})},z=le=>{i.value=le},j=n,oe=async()=>{j("submit",y.value),L.value=!1},re=()=>{$.value&&($.value.destroy(),k.value=new Date().getTime(),r.value.doLayout()),vue.nextTick(()=>{const le=document.querySelector(".custom-column-dialog tbody");$.value=Sortable.create(le,{handle:".move",animation:300,filter:".operation",onEnd({newIndex:de,oldIndex:pe}){if(!de&&de!==0||!pe&&pe!==0)return;let ue=cloneDeep(y.value);const he=ue[pe];if(de<pe)for(let Ce=de;Ce<pe;Ce++)ue[Ce].order=String(Number(ue[Ce].order)+1);else for(let Ce=pe+1;Ce<=de;Ce++)ue[Ce].order=String(Number(ue[Ce].order)-1);he.order=String(de),y.value=cloneDeep(ue)}})})},ie=()=>{const le=cloneDeep(g.originTableColumns);i.value?y.value=le:y.value=y.value.map(de=>{const pe=y.value.find(ue=>ue.prop===de.prop);return!(pe!=null&&pe.isShow)||pe.prop==="operation"?de:le.find(ue=>ue.prop===de.prop)}),re()},ae=()=>{L.value=!1};return e({openColSetting:V}),(le,de)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createVNode(_sfc_main$s,{modelValue:L.value,"onUpdate:modelValue":de[1]||(de[1]=pe=>L.value=pe),size:"middle"},{header:vue.withCtx(()=>de[2]||(de[2]=[vue.createElementVNode("div",{class:"title"},"自定义列",-1),vue.createElementVNode("div",{class:"sub-title"},"勾选需要展示的列,拖动列名进行排序",-1)])),footer:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_7$1,[vue.createVNode(vue.unref(ElCheckbox),{modelValue:i.value,"onUpdate:modelValue":de[0]||(de[0]=pe=>i.value=pe),class:"checkbox",label:"全局",onChange:z},null,8,["modelValue"]),vue.createElementVNode("div",_hoisted_8$1,[vue.createVNode(ZhButton$1,{plain:"",onClick:ae},{default:vue.withCtx(()=>de[4]||(de[4]=[vue.createTextVNode("取消")])),_:1}),vue.createVNode(ZhButton$1,{plain:"",class:"w-auto",onClick:ie},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(i.value?"全局恢复默认":"恢复默认"),1)]),_:1}),vue.createVNode(ZhButton$1,{type:"primary",onClick:oe},{default:vue.withCtx(()=>de[5]||(de[5]=[vue.createTextVNode("保存")])),_:1})])])]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[(vue.openBlock(),vue.createBlock(vue.unref(ElTable),{ref_key:"tableRef",ref:r,class:"custom-colum-table",key:k.value,data:y.value,"row-class-name":pe=>pe.row.prop==="operation"?"operation":""},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTableColumn),{width:"100",label:"选择"},{default:vue.withCtx(({row:pe})=>[vue.createVNode(vue.unref(ElCheckbox),{class:"custom-column-check",modelValue:pe.isShow,"onUpdate:modelValue":ue=>pe.isShow=ue,disabled:pe.readonly},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"label",label:"名称"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",_hoisted_3$2,[vue.createTextVNode(vue.toDisplayString(pe.label)+" ",1),pe.readonly?(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$1,"(必选)")):vue.createCommentVNode("",!0),pe.prop!=="operation"?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:"move move-icon"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(rank_default))]),_:1})):vue.createCommentVNode("",!0)])]),_:1}),vue.createVNode(vue.unref(ElTableColumn),{prop:"width",label:"宽度",width:"180"},{default:vue.withCtx(({row:pe})=>[vue.createElementVNode("div",{class:vue.normalizeClass(`custom-width-box ${pe.readonly&&"readonly"}`)},[de[3]||(de[3]=vue.createElementVNode("span",{class:"text"},"宽度",-1)),vue.createElementVNode("span",_hoisted_5$1,vue.toDisplayString(pe.width)+" px",1),pe.readonly?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$1,[vue.createVNode(vue.unref(ElInputNumber),{modelValue:pe.width,"onUpdate:modelValue":ue=>pe.width=ue,class:"custom-width-input",min:10,max:1e3,controls:!1},null,8,["modelValue","onUpdate:modelValue"])]))],2)]),_:1})]),_:1},8,["data","row-class-name"]))])]),_:1},8,["modelValue"])]))}}),ColSetting=_export_sfc(_sfc_main$2,[["__scopeId","data-v-fd937235"]]),_hoisted_1$1={class:"no-card table-main zh-table"},_hoisted_2$1={class:"table-title-container"},_hoisted_3$1={key:0,class:"table-title"},_hoisted_4={key:1,class:"table-header-tip"},_hoisted_5={class:"table-header-container"},_hoisted_6={key:0,class:"table-header"},_hoisted_7={class:"header-button-ri"},_hoisted_8={key:0},_hoisted_9={class:"table-body-container"},_hoisted_10={class:"text d-flex inline-input-text pointer"},_hoisted_11={key:1,class:"inline-input-box d-flex"},_hoisted_12={class:"table-empty"},_hoisted_13=["src"],_sfc_main$1=vue.defineComponent({name:"ZhTable",__name:"Table",props:{columns:{default:()=>[]},data:{},requestApi:{},requestAuto:{type:Boolean,default:!0},requestError:{type:Function,default:t=>{console.error("protable中请求数据错误",t)}},handleParam:{},dataCallback:{},selectChangeCallback:{},title:{},pagination:{type:Boolean,default:!0},initParam:{default:{}},border:{type:Boolean,default:!1},rowKey:{default:"id"},isShowSearch:{type:Boolean,default:!0},maxHeight:{},isShowSearchBtn:{type:Boolean,default:!0},isShowResetBtn:{type:Boolean,default:!0},customColumn:{type:Boolean,default:!1},onSortChange:{},offset:{},customColumnCacheKey:{},customColumnPageCacheKey:{},beforeReset:{}},emits:["search","reset","dargSort"],setup(t,{expose:e,emit:n}){var Un;const r=vue.ref(new Date().getTime()),i={mounted(xn){var On;(On=xn.querySelector("input"))==null||On.focus()}},g=vue.useSlots(),y=t,k=vue.ref(),L=["selection","radio","index","expand","sort","input"],$=vue.ref(y.isShowSearch),V=vue.ref(""),z=vue.ref({}),j=vue.ref(y.maxHeight||"1000px"),{selectionChange:oe,selectedList:re,selectedListIds:ie,isSelected:ae}=useSelection(y.rowKey,y.selectChangeCallback),{loading:le,tableData:de,pageable:pe,searchParam:ue,searchInitParam:he,getTableList:Ce,search:_e,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe}=useTable(y.requestApi,y.initParam,y.pagination,y.dataCallback,y.requestError,y.handleParam),$e=xn=>{function On(er){return er.replace(/[A-Z]/g,ar=>"_"+ar.toLowerCase())}const Ln={ascending:"asc",descending:"desc"},{prop:_n,order:Mn}=xn,Wn=On(handleProp(_n)),Qn=Ln[Mn];ue.value={...ue.value,sortKey:Wn,sortOrder:Qn},pe.value.page=1,_e()},qe=()=>k.value.clearSelection(),Pt=()=>k.value.clearSort(),Lt=vue.ref(!1),Ve=()=>{En(),y.customColumn&&Zn(),y.requestAuto&&Ce(),y.data&&(pe.value.total=y.data.length)};vue.onMounted(()=>{Ve(),vue.nextTick(()=>{Lt.value=!0})}),vue.onActivated(()=>{Lt.value&&Ve()}),vue.onDeactivated(()=>{}),vue.onUnmounted(()=>{});const Fe=vue.computed(()=>y.data?y.pagination?y.data.slice((pe.value.page-1)*pe.value.size,pe.value.size*pe.value.page):y.data:de.value),ze=xn=>{pe.value.total=xn};vue.watch(()=>y.initParam,Ce,{deep:!0});let Ue=vue.reactive(y.columns);const Ne=vue.computed(()=>hn(Ue)),Et=vue.ref(new Map),kt=async({prop:xn,enum:On})=>{if(!On||Et.value.has(xn)&&(typeof On=="function"||Et.value.get(xn)===On))return;if(typeof On!="function")return Et.value.set(xn,vue.unref(On));Et.value.set(xn,[]);const{data:Ln}=await On();Et.value.set(xn,Ln)};vue.provide("enumMap",Et);const hn=(xn,On=[])=>(xn.forEach(async Ln=>{var _n;(_n=Ln._children)!=null&&_n.length&&On.push(...hn(Ln._children)),On.push(Ln),Ln.isShow=Ln.isShow??!0,Ln.isFilterEnum=Ln.isFilterEnum??!0,await kt(Ln)}),On.filter(Ln=>{var _n;return!((_n=Ln._children)!=null&&_n.length)})),Dt=vue.computed(()=>{var xn;return(xn=Ne.value)==null?void 0:xn.filter(On=>{var Ln,_n;return((Ln=On.search)==null?void 0:Ln.el)||((_n=On.search)==null?void 0:_n.render)}).sort((On,Ln)=>On.search.order-Ln.search.order)});(Un=Dt.value)==null||Un.forEach((xn,On)=>{var Mn,Wn,Qn;xn.search.order=((Mn=xn.search)==null?void 0:Mn.order)??On+2;const Ln=((Wn=xn.search)==null?void 0:Wn.key)??handleProp(xn.prop),_n=(Qn=xn.search)==null?void 0:Qn.defaultValue;_n!=null&&(he.value[Ln]=_n,ue.value[Ln]=_n)});const jt=n,Tn=()=>{var xn;(xn=k.value)==null||xn.clearSelection(),_e(),jt("search")},kn=()=>{y.beforeReset&&y.beforeReset(),xe(),Pt(),jt("reset")},En=()=>{const xn=document.querySelector(".el-table__body-wrapper tbody");xn&&Sortable.create(xn,{handle:".move",animation:300,onEnd({newIndex:On,oldIndex:Ln}){const[_n]=Fe.value.splice(Ln,1);Fe.value.splice(On,0,_n),jt("dargSort",{newIndex:On,oldIndex:Ln})}})},Cn=vue.ref(0),In=(xn,On)=>{const Ln=de.value.findIndex(_n=>_n.$showInput);Ln>-1&&(de.value[Ln]=cloneDeep(z.value),de.value[Ln].$showInput=!1),Cn.value=$get(xn,String(On)),xn.$showInput=!0,z.value=cloneDeep(xn)},An=async(xn,On,Ln)=>{set$2(xn,On,Cn.value),Ln&&await Ln(xn),xn.$showInput=!1,ElMessage.success("更新成功"),await Ce()},Nn=async xn=>{const On=de.value.findIndex(Ln=>isEqual(pickBy$1(Ln,identity$1),pickBy$1(xn,identity$1)));On>-1&&(de.value[On]=cloneDeep(z.value),de.value[On].$showInput=!1)},Vn=useColSetting(y.customColumnCacheKey),Bn=vue.ref(null),Yn=()=>Ue.map((xn,On)=>({readonly:xn.isCustomDisable||["id","operation"].includes(String(xn.prop)),order:On,index:On,width:xn.width||xn.minWidth,...xn})).sort((xn,On)=>{const Ln=Number(xn.order),_n=Number(On.order);return Ln-_n}),Xn=()=>{zn=vue.reactive(Yn()),vue.nextTick(()=>{Bn.value.openColSetting(cloneDeep(zn))})},Zn=()=>{if(!y.customColumnPageCacheKey)return;const xn=Vn.getColumnCache(y.customColumnPageCacheKey);if(xn!=null&&xn.length){const On=Ue.map(Ln=>{const _n=xn.find(Mn=>Mn.prop===Ln.prop);if(_n){const Mn={...Ln,order:_n.order||Ln.order,isShow:_n.isShow!==void 0?_n.isShow:Ln.isShow,readonly:_n.readonly!==void 0?_n.readonly:Ln.readonly,prop:_n.prop||Ln.prop,index:_n.index||Ln.index};return Ln.minWidth&&(Mn.minWidth=_n.minWidth||Ln.minWidth),Ln.width&&(Mn.width=_n.width||Ln.width),Mn}return Ln});zn=vue.reactive(On),Ue=vue.reactive(zn)}};let zn=vue.reactive(Yn());const jn=cloneDeep(Yn()),$n=xn=>{if(!y.customColumnPageCacheKey)return console.error("请添加自定义列缓存配置项:customColumnPageCacheKey");xn=xn.map(On=>{const Ln=jn.find(_n=>_n.prop===On.prop);return Ln&&Ln.minWidth&&(On.minWidth=On.width,delete On.width),On}),Ue=vue.reactive(cloneDeep(xn)),Vn.setColumnCache(y.customColumnPageCacheKey,xn),r.value=new Date().getTime(),k.value.doLayout()};return e({element:k,tableData:Fe,radio:V,pageable:pe,searchParam:ue,searchInitParam:he,setPageTotal:ze,getTableList:Ce,search:_e,reset:xe,handleSizeChange:Ie,handleCurrentChange:Oe,clearSelection:qe,enumMap:Et,isSelected:ae,selectedList:re,selectedListIds:ie}),(xn,On)=>{const Ln=vue.resolveDirective("loading");return vue.openBlock(),vue.createBlock(vue.unref(ElConfigProvider),{locale:vue.unref(zhCn)},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createElementVNode("div",_hoisted_2$1,[xn.title?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,vue.toDisplayString(xn.title),1)):vue.createCommentVNode("",!0),vue.unref(g).headerTip?(vue.openBlock(),vue.createElementBlock("div",_hoisted_4,[vue.renderSlot(xn.$slots,"headerTip",{},void 0,!0)])):vue.createCommentVNode("",!0)]),vue.createElementVNode("div",_hoisted_5,[vue.withDirectives(vue.createVNode(SearchForm,{search:Tn,reset:kn,columns:Dt.value,"search-param":vue.unref(ue),"is-show-reset-btn":y.isShowResetBtn,"is-show-search-btn":y.isShowSearchBtn},{default:vue.withCtx(()=>[xn.$slots.tableHeader?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6,[vue.createElementVNode("div",_hoisted_7,[vue.renderSlot(xn.$slots,"tableHeader",{selectedList:vue.unref(re),selectedListIds:vue.unref(ie),isSelected:vue.unref(ae)},void 0,!0)])])):vue.createCommentVNode("",!0)]),_:3},8,["columns","search-param","is-show-reset-btn","is-show-search-btn"]),[[vue.vShow,$.value]])]),vue.unref(g).searchBarBottom?(vue.openBlock(),vue.createElementBlock("div",_hoisted_8,[vue.renderSlot(xn.$slots,"searchBarBottom",{},void 0,!0)])):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_9,[y.customColumn?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"col-setting-button",onClick:Xn},[vue.createVNode(vue.unref(ElTooltip),{class:"box-item",effect:"dark",content:"自定义列",placement:"top"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),{size:14,color:"#000000a6"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(setting_default))]),_:1})]),_:1})])):vue.createCommentVNode("",!0),vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElTable),vue.mergeProps({ref_key:"tableRef",ref:k},xn.$attrs,{key:r.value,data:Fe.value,border:xn.border,"row-key":xn.rowKey,"max-height":j.value,"row-style":{height:"42px"},"tooltip-effect":"light","tooltip-options":{showArrow:!1,placement:"bottom-start",offset:y.offset?y.offset:-20}},vue.toHandlers(xn.$attrs),{onSelectionChange:vue.unref(oe),onSortChange:On[1]||(On[1]=_n=>y.onSortChange?y.onSortChange(_n):$e(_n))}),{append:vue.withCtx(()=>[vue.renderSlot(xn.$slots,"append",{},void 0,!0)]),empty:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_12,[vue.renderSlot(xn.$slots,"empty",{},()=>[vue.createElementVNode("img",{src:`${vue.unref(CDN_URL$1)}ghy-components/empty.png`,class:"zh-empty-img",alt:"notData"},null,8,_hoisted_13),On[5]||(On[5]=vue.createElementVNode("div",null,"暂无数据",-1))],!0)])]),default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(Ue).sort((_n,Mn)=>_n.order-Mn.order),_n=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:_n},[_n.type&&L.includes(_n.type)&&_n.isShow?(vue.openBlock(),vue.createBlock(vue.unref(ElTableColumn),vue.mergeProps({key:0,ref_for:!0},_n,{align:_n.align??"left","reserve-selection":_n.type=="selection"}),vue.createSlots({default:vue.withCtx(Mn=>[_n.type=="expand"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[_n.render?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.render),vue.mergeProps({key:0,ref_for:!0},Mn),null,16)):vue.renderSlot(xn.$slots,_n.type,vue.mergeProps({key:1,ref_for:!0},Mn),void 0,!0)],64)):vue.createCommentVNode("",!0),_n.type=="sort"?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,class:"move"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElIcon),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(d_caret_default))]),_:1})]),_:1})):vue.createCommentVNode("",!0),_n.type=="input"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:2},[Mn.row.$showInput?(vue.openBlock(),vue.createElementBlock("div",_hoisted_11,[vue.withDirectives(vue.createVNode(vue.unref(ElInputNumber),{modelValue:Cn.value,"onUpdate:modelValue":On[0]||(On[0]=Wn=>Cn.value=Wn),min:0,controls:!1},null,8,["modelValue"]),[[i]]),vue.createVNode(vue.unref(ElLink),{underline:!1,type:"primary",onClick:Wn=>An(Mn.row,String(_n.prop),_n.blurCallback),class:"ml-5"},{default:vue.withCtx(()=>On[3]||(On[3]=[vue.createTextVNode(" 保存 ")])),_:2},1032,["onClick"]),vue.createVNode(vue.unref(ElLink),{type:"primary",underline:!1,onClick:Wn=>Nn(Mn.row),class:"ml-5"},{default:vue.withCtx(()=>On[4]||(On[4]=[vue.createTextVNode(" 取消 ")])),_:2},1032,["onClick"])])):(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:"编辑",placement:"top"},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_10,[vue.createTextVNode(vue.toDisplayString(vue.unref($get)(Mn.row,String(_n.prop)))+" ",1),vue.createVNode(vue.unref(ElLink),{underline:!1,class:"text d-flex inline-input-text pointer",onClick:Wn=>In(Mn.row,_n.prop)},{default:vue.withCtx(()=>On[2]||(On[2]=[vue.createElementVNode("i",{class:"iconfont icon-edit"},null,-1)])),_:2},1032,["onClick"])])]),_:2},1024))],64)):vue.createCommentVNode("",!0)]),_:2},[_n.headerRender?{name:"header",fn:vue.withCtx(Mn=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(_n.headerRender),vue.mergeProps({ref_for:!0},Mn),null,16))]),key:"0"}:void 0]),1040,["align","reserve-selection"])):vue.createCommentVNode("",!0),!_n.type&&_n.prop&&_n.isShow?(vue.openBlock(),vue.createBlock(_sfc_main$3,{key:1,column:_n,"custom-column":xn.customColumn},vue.createSlots({_:2},[vue.renderList(Object.keys(xn.$slots),Mn=>({name:Mn,fn:vue.withCtx(Wn=>[vue.renderSlot(xn.$slots,Mn,vue.mergeProps({ref_for:!0},Wn),void 0,!0)])}))]),1032,["column","custom-column"])):vue.createCommentVNode("",!0)],64))),128))]),_:3},16,["data","border","row-key","max-height","tooltip-options","onSelectionChange"])),[[Ln,vue.unref(le)]])]),vue.renderSlot(xn.$slots,"pagination",{},()=>[xn.pagination?(vue.openBlock(),vue.createBlock(TablePagination,{key:0,pageable:vue.unref(pe),"handle-size-change":vue.unref(Ie),"handle-current-change":vue.unref(Oe)},{zhPaginationLeftSlot:vue.withCtx(_n=>[vue.renderSlot(xn.$slots,"zhPaginationLeft",vue.normalizeProps(vue.guardReactiveProps(_n)),void 0,!0)]),_:3},8,["pageable","handle-size-change","handle-current-change"])):vue.createCommentVNode("",!0)],!0)]),y.customColumn?(vue.openBlock(),vue.createBlock(ColSetting,{key:0,ref_key:"colRef",ref:Bn,"origin-table-columns":vue.unref(jn),onSubmit:$n},null,8,["origin-table-columns"])):vue.createCommentVNode("",!0)]),_:3},8,["locale"])}}}),Table=_export_sfc(_sfc_main$1,[["__scopeId","data-v-83e26bf1"]]),ZhTable=withInstall$1(Table),_hoisted_1={key:1},_hoisted_2={key:1,class:"zh-base-item--value--file"},_hoisted_3={key:2},_sfc_main=vue.defineComponent({name:"ZhBaseItem",__name:"BaseItem",props:{label:{},labelRender:{},colon:{type:Boolean,default:!1},value:{},fileId:{},rewriteFileName:{},valueRender:{},onClick:{},labelWidth:{},infoDirection:{default:"horizontal"},defaultValue:{default:DEFAULT_VALUE$1},className:{},labelClassName:{},valueClassName:{},span:{default:1},showFileName:{type:Boolean,default:!0},fetchFileById:{}},setup(t){const e=vue.useSlots(),n=t,r=vue.inject("infoLabelWidth",void 0),i=vue.computed(()=>!!(n.onClick&&n.value)),g=vue.computed(()=>!!(!n.value&&n.fileId)),y=vue.ref(),k=vue.computed(()=>{var j;const z=(j=y.value)==null?void 0:j.name;if(!z)return"";if(n.rewriteFileName){const oe=z.substring(z.lastIndexOf("."));return n.rewriteFileName+oe}return z}),L=vue.computed(()=>{const z={},j=n.labelWidth||r;return j&&n.infoDirection==="horizontal"&&(isNaN(Number(j))?z.width=j:z.width=j+"px"),z}),$=vue.computed(()=>({...L.value})),V=vue.computed(()=>n.value===""?DEFAULT_VALUE$1:n.value??DEFAULT_VALUE$1);return vue.watchEffect(async()=>{!g.value||!n.fileId||!n.fetchFileById||(y.value=await n.fetchFileById(n.fileId))}),(z,j)=>(vue.openBlock(),vue.createBlock(vue.unref(ZhGridItem),{span:z.span,label:z.label},{default:vue.withCtx(oe=>{var re;return[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item",[z.infoDirection,z.className]])},[vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-label",[z.infoDirection,z.labelClassName]]),style:vue.normalizeStyle({width:z.infoDirection==="horizontal"&&oe.maxLabelWidthInCol?oe.maxLabelWidthInCol+"px":void 0,...$.value})},[z.labelRender?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.labelRender),{key:0})):(vue.openBlock(),vue.createElementBlock("span",_hoisted_1,vue.toDisplayString(z.label)+vue.toDisplayString(z.colon?":":""),1))],6),vue.createElementVNode("div",{class:vue.normalizeClass(["zh-base-item-value",z.valueClassName])},[vue.unref(e).value?vue.renderSlot(z.$slots,"value",{key:0,content:z.value}):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[i.value?(vue.openBlock(),vue.createBlock(vue.unref(ElLink),{key:0,type:"primary",onClick:j[0]||(j[0]=vue.withModifiers(ie=>z.onClick&&z.onClick(z.value),["stop"]))},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(z.value),1)]),_:1})):g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_2,[z.showFileName?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createVNode(vue.unref(ElIcon),{class:"iconfont"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(document_default))]),_:1}),vue.createTextVNode(" "+vue.toDisplayString(k.value),1)],64)):vue.createCommentVNode("",!0),vue.createVNode(vue.unref(ElLink),{type:"primary",href:(re=y.value)==null?void 0:re.path,target:"_blank",class:vue.normalizeClass({"ml-8":z.showFileName})},{default:vue.withCtx(()=>j[1]||(j[1]=[vue.createTextVNode(" 查看/下载 ")])),_:1},8,["href","class"])])):z.valueRender?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3,[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(z.valueRender)))])):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:3},[vue.createTextVNode(vue.toDisplayString(V.value),1)],64))],64))],2)],2)]}),_:3},8,["span","label"]))}}),ZhBaseItem=withInstall$1(_sfc_main),components=[ZhBaseInfo,ZhButton,ZhDatePicker,ZhDetailHeader,ZhDetailSubTitle,ZhDialog,ZhDiyDataTable,ZhEditInfoPair,ZhFileWrapper,ZhGrid,ZhGridItem,ZhMultiGrid,ZhInfoPair,ZhInput,ZhInputNumber,ZhLoading,ZhMessageBox,ZhConfirm,ZhAlert,ZhPrompt,ZhMoneyInput,ZhPageHeadPanel,ZhToolTips,ZhMap,ZhButtonGroup,ZhTable],installer=makeInstaller(components);exports.CDN_URL=CDN_URL,exports.DEFAULT_VALUE=DEFAULT_VALUE,exports.DIY_DATA_TYPE=DIY_DATA_TYPE,exports.LOG_DATE_FORMAT=LOG_DATE_FORMAT,exports.ZhAlert=ZhAlert,exports.ZhBaseInfo=ZhBaseInfo,exports.ZhBaseItem=ZhBaseItem,exports.ZhButton=ZhButton,exports.ZhButtonGroup=ZhButtonGroup,exports.ZhConfirm=ZhConfirm,exports.ZhDatePicker=ZhDatePicker,exports.ZhDetailHeader=ZhDetailHeader,exports.ZhDetailSubTitle=ZhDetailSubTitle,exports.ZhDialog=ZhDialog,exports.ZhDiyDataTable=ZhDiyDataTable,exports.ZhEditInfoPair=ZhEditInfoPair,exports.ZhFileWrapper=ZhFileWrapper,exports.ZhGrid=ZhGrid,exports.ZhGridItem=ZhGridItem,exports.ZhInfoPair=ZhInfoPair,exports.ZhInput=ZhInput,exports.ZhInputNumber=ZhInputNumber,exports.ZhLoading=ZhLoading,exports.ZhMap=ZhMap,exports.ZhMessageBox=ZhMessageBox,exports.ZhMoneyInput=ZhMoneyInput,exports.ZhMultiGrid=ZhMultiGrid,exports.ZhPageHeadPanel=ZhPageHeadPanel,exports.ZhPrompt=ZhPrompt,exports.ZhTable=ZhTable,exports.ZhToolTips=ZhToolTips,exports.baseMap=baseMap,exports.default=installer,exports.mapDefaultCenter=mapDefaultCenter,exports.mapZoom=mapZoom,exports.projection=projection,exports.renderShipsLimit=renderShipsLimit,exports.tiandituKey=tiandituKey,exports.zhongkeKey=zhongkeKey,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});