diff --git a/src/main/resources/static/axui-v2.1.1/js/ax.js b/src/main/resources/static/axui-v2.1.1/js/ax.js index 6281dfa..a3187f5 100644 --- a/src/main/resources/static/axui-v2.1.1/js/ax.js +++ b/src/main/resources/static/axui-v2.1.1/js/ax.js @@ -1914,7 +1914,7 @@ const axAjax = (option, elem, callback) => { type: 'post', async: true, data: {}, - delay: 60000, + delay: 6000000, contentType: '', headers: {}, responseType: '', diff --git a/src/main/resources/static/axui-v2.1.1/js/ax.min.js b/src/main/resources/static/axui-v2.1.1/js/ax.min.js index 9a2993b..041bad9 100644 --- a/src/main/resources/static/axui-v2.1.1/js/ax.min.js +++ b/src/main/resources/static/axui-v2.1.1/js/ax.min.js @@ -1,4 +1,4 @@ -"use strict";const axError={formatError:"This is not a valid data format!",paraError:"The parameters do not meet the requirements!",arrayRequired:"The value must be an array type!",noNode:"This page can not find the node!",required:"Required field is missing!",notExist:"The program cannot be executed because the object does not exist!"},axIsMobi=()=>"ontouchstart"in document.documentElement,axEventMap=axIsMobi()?["touchstart","touchmove","touchend","touchcancel"]:["mousedown","mousemove","mouseup","mouseleave"],axIsDate=t=>isNaN(t)&&!isNaN(Date.parse(t)),axCeil={phone:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-phone")),pad:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pad")),flip:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-flip")),pro:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pro")),pc:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pc"))},axClient=()=>{let t=document.body.clientWidth;return taxCeil.phone&&taxCeil.pad&&taxCeil.flip&&tObject.prototype.toString.call(t).slice(8,-1),axIsEmpty=t=>{let e=axType(t);return!t||("Function"===e?"{}"==t.toString().replace(/\s+/g,"").match(/{.*}/g)[0]:"Array"===e?""==t.join(""):"Object"===e&&0===Object.keys(t).length)},axToNumber=t=>isNaN(t)?parseFloat(t):t,axTheme={set:(t,e="")=>{if(axIsEmpty(t))return!1;let s=t=>{t=t.trim();let e=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,s=t.toLowerCase(),i=[];if(e.test(s)){if(4===s.length){let t="#";for(let e=1;e<4;e+=1)t+=s.slice(e,e+1).concat(s.slice(e,e+1));s=t}for(let t=1;t<7;t+=2)i.push(parseInt("0x"+s.slice(t,t+2)))}return i},i=t=>{let e,s,i=t[0]/255,o=t[1]/255,a=t[2]/255,n=Math.min(i,o,a),r=Math.max(i,o,a),l=(n+r)/2,h=r-n;if(r===n)e=0,s=0;else{switch(s=l>.5?h/(2-r-n):h/(r+n),r){case i:e=(o-a)/h+(o{let e=axType(t),o=[];if(!axIsEmpty(t))if("String"===e)if(t=t.trim().toLowerCase(),t.startsWith("hsl"))o=t.replace(/^(hsl|hsla)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",");else{let e=[];t.startsWith("#")?e=s(t):t.startsWith("rgb")&&(e=t.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",").map(Number)),o=i(e)}else"Array"===e&&(o=t);return 3===o.length&&o.push(1),o},a=axType(t),n={primary:[],text:[],error:[],success:[],info:[],warning:[],question:[]};if("Object"===a)for(let e in t)t.hasOwnProperty(e)&&t[e].length>2&&(n[e]=o(t[e]));else n.primary=o(t);axIsEmpty(axLocalStorage.get("ax-theme-raw"))&&axLocalStorage.set("ax-theme-raw",axGetColors());let r=document.querySelector(":root");for(let t in n)n.hasOwnProperty(t)&&n[t].length>2&&(r.style.setProperty(`--h-${t}`,n[t][0]),r.style.setProperty(`--s-${t}`,"string"==typeof n[t][1]&&n[t][1].includes("%")?n[t][1]:n[t][1]+"%"),r.style.setProperty(`--l-${t}`,"string"==typeof n[t][2]&&n[t][2].includes("%")?n[t][2]:n[t][2]+"%"),r.style.setProperty(`--a-${t}`,n[t][3]));e&&axLocalStorage.set(e,n)},get:()=>axGetColors(),reset:()=>{}};axTheme.reset=(()=>{let t=axLocalStorage.get("ax-theme-raw");axTheme.set(t)});const axGetScrollObj=()=>navigator.userAgent.indexOf("Firefox")>0?{event:"DOMMouseScroll",detail:"detail"}:{event:"mousewheel",detail:"wheelDelta"},axGetClientObj=t=>{let e=axIsMobi()?t.targetTouches[0]:t;return e?{x:e.clientX,y:e.clientY}:null},axIsScrollUp=(t,e=axGetScrollObj().detail)=>{let s,i=t[e];return s=navigator.userAgent.indexOf("Firefox")>0?i>0:i<0,s},axIsVnode=t=>!getComputedStyle(t).display,axNumber=(t,e)=>{let s=Object.assign({places:2,mode:"round",zero:!1},e),i=0;if(!t||!Number(t))return 0;{let e=Number(t),o=e+Number.EPSILON,a=Number(`1${"0".repeat(s.places)}`),n=e*a,r=o*a;i="floor"===s.mode?Math.floor(n)/a:"ceil"===s.mode?Math.ceil(n)/a:Math.round(r)/a}return s.zero&&(i=i.toFixed(s.places)),i},axTrim=(t,e=!1)=>e?t.replace(/\s+/g,""):t.trim().replace(/\s+/gi," "),axSplitToArr=(t,e=",",s="all")=>{let i=axType(t),o="",a=[];return"String"===i?(o="one"===s?axTrim(t,!1):"none"===s?axTrim(t,!0):t.trim(),a=o.split(e)):"Array"===i&&(a=t),a},axPreventDefault=t=>{t.preventDefault?t.preventDefault():t.returnValue=!1},axStrEnd=(t,e,s="afterend",i=!0)=>{if(!t||!e)return!1;if(t=t.trim(),t.includes(e)){let o,a,n=e.length;return"beforebegin"===s?(o=t.indexOf(e),i&&(o+=n),a=t.substring(0,o)):"afterbegin"===s?(o=t.indexOf(e),!i&&(o+=n),a=t.substring(o,t.length)):"beforeend"===s?(o=t.lastIndexOf(e),i&&(o+=n),a=t.substring(0,o)):"afterend"===s?(o=t.lastIndexOf(e),!i&&(o+=n),a=t.substring(o,t.length)):a="",a}return""},axStrType=t=>{if("string"!=typeof t)return console.error("Argument must be a string!"),!1;t=t.trim();let e=t=>{if(t>="A"&&t<="Z")return!0},s="";return t&&(t.includes(" ")?s="level":t.startsWith("#")?s="id":t.startsWith(".")?s="class":t.startsWith("[")&&t.endsWith("]")?s="name":(["H1","H2","H3","H4","H5","H6"].includes(t)||[...t].every(t=>e(t)))&&(s="node")),s},axStrToDom=t=>{if("string"!=typeof t)return!1;let e;return t=t.trim(),t.startsWith("")?(e=document.createElement("tr"),e.innerHTML=t,e):(e=document.createElement("div"),e.innerHTML=t,e.firstElementChild)},axIdToDom=t=>{let e=axType(t);if(t){if("String"===e){let e=t.trim();return axStrType(e)?("name"!==axStrType(e)||e.includes("=")||(e=e.slice(0,1)+"name="+e.slice(1)),document.querySelector(e)):(console.warn("No node is found with this string!"),!1)}return!!e.includes("HTML")&&t}return console.warn("Node selector is empty!"),!1},axAllToDoms=t=>{if(axIsEmpty(t))return[];let e=[],s=axType(t);if(s.includes("HTML"))e.push(t);else if("String"===s){let s=axTrim(t),i=",";s.includes(" ")&&(i=" "),s.split(i).forEach(t=>{let s=axIdToDom(t);s&&e.push(s)})}else"Array"===s?t.forEach(t=>{let s=axIdToDom(t);s&&e.push(s)}):"NodeList"===s&&(e=[...t]);return e},axValueToArr=t=>{let e=[];if(!axIsEmpty(t)||0===t)if(Array.isArray(t))e=t;else if("string"==typeof t){let s=t.trim(),i=t.includes(",")?",":" ";s.includes(i)?e=s.split(i):e.push(t)}else e.push(t);return e},axUnique=(t,e)=>{if(e){let s=new Map;for(let i of t)s.has(i[e])||s.set(i[e],i);return[...s.values()]}return[...new Set(t)]},axClass={get:function(t){return axValueToArr(t)},add:function(t,e,s){let i=axIdToDom(t),o=this.get(e);return!(!i||0===o.length)&&(o.forEach(t=>{let e=!s||s(t);e&&i.classList.add(t)}),this)},del:function(t,e,s){let i=axIdToDom(t),o=this.get(e);return!(!i||0===o.length)&&(o.forEach(t=>{let e=!s||s(t);e&&i.classList.remove(t)}),this)}},axArrToDom=(t,e)=>{let s=t.split(","),i=[],o=/^[0-9]*$/,a="";return a="string"==typeof e?document.querySelector(e):e,s.forEach(t=>{if(!o.test(t.substr(0,1)))if("class"==axStrType(t))i=a?i.concat([...a.querySelectorAll(t)]):i.concat([...document.querySelectorAll(t)]);else if("id"==axStrType(t))i.push(document.querySelector(t));else{if(!t)return i;{let e=document.querySelectorAll(t);e&&(i=a?i.concat([...a.querySelectorAll(t)]):i.concat([...document.querySelectorAll(t)]))}}}),i},axArrToFlat=t=>{let e=[],s=[...t];return s.forEach(t=>{t.children?e=[...e,t,...axArrToFlat(t.children)]:e.push(t)}),e},axIncreaseId=(t,e=!0)=>{let s,i=[];return e?(t.forEach(t=>{i.push(~~t.id)}),s=Math.max(...i)+1):s=t.length,s},axMultiValues=(t,e="checkbox",s="array",i,o=",")=>{let a,n=[],r=i?axIdToDom(i):"";if("NodeList"==axType(t)||"Array"==axType(t)){if(e.includes("select")||"file"==e)return console.warn("Can not be an node array in this type!"),!1;a=t}else if("object"==typeof t||axStrType(t)&&"name"!==axStrType(t)){let s=axIdToDom(t);e.includes("select")||"SELECT"==t.nodeName?(e="select",a=s.options):"file"==e||"file"==s.type?(e="file",a=[s]):a=[...s.querySelectorAll("input")]}else{let s="";s="name"===axStrType(t)?t.replace("[","[name="):`[name=${t}]`,a=e.includes("select")?r?r.querySelector(s).options:document.querySelector(s).options:"file"==e?r?[r.querySelector(s)]:[document.querySelector(s)]:r?[...r.querySelectorAll(s)]:[...document.querySelectorAll(s)]}for(let t=0;t{let i=null,o=function(o){s&&(o.stopPropagation(),o.preventDefault()),i&&clearTimeout(i),i=setTimeout(()=>{t.apply(this,arguments)},e)};return o.cancel=function(){i&&clearTimeout(i)},o},axThrottle=(t,e=500,s=!1)=>{let i=0,o=null,a=function(a){let n=(new Date).getTime();n-i>e?(o&&(clearTimeout(o),o=null),t.apply(this,arguments),i=n):s&&(a.stopPropagation(),a.preventDefault())};return a.cancel=function(){clearTimeout(o),o=null},a},axMoveArr=(t,e,s)=>{if(e>t.length||s>t.length||e<0||s<0)return console.error("Exceeded array length!"),!1;let i=t[e];return t.splice(e,1),t.splice(s,0,i),t},axIsVisible=t=>{let e=axIdToDom(t),s=!0,i="none"!=getComputedStyle(e).display&&"hidden"!=getComputedStyle(e).visibility;for(;s&&i;)e=e.parentNode,e&&e!=document.body?i="none"!=getComputedStyle(e).display&&"hidden"!=getComputedStyle(e).visibility:s=!1;return i},axClampValue=(t={value:value,min:min,max:max})=>t.hasOwnProperty("min")&&t.hasOwnProperty("max")?(t.value=axToNumber(t.value),t.min=axToNumber(t.min),t.max=axToNumber(t.max),t.value>t.max?t.max:t.value{let s=axIdToDom(e),i=axIdToDom(t),o=s.scrollTop,a=s.getBoundingClientRect().height;return i.offsetTop+i.offsetHeight>o&&i.offsetTop{let i=axIdToDom(t),o=e;if(!t)return console.error(axError.notExist),!1;let a=()=>{let t=[];return[...i.children].forEach(e=>{t.push(r(e,o++))}),t},n=(t,e)=>{let s=[...t.attributes].filter(t=>"label"!==t.name&&"value"!==t.name);s.forEach(t=>{["selected","disabled","readonly","active","checked","expanded"].includes(t.name)?e[t.name]=!0:e[t.name]=t.value.trim()})},r=(t,e)=>{let i=t.firstElementChild,a={id:e,node:i};a.label=i.textContent.trim(),s?a.value=i.hasAttribute("value")?i.getAttribute("value"):a.label:i.hasAttribute("value")&&(a.value=i.getAttribute("value")),n(i,a);let l=t.querySelector("ul")||t.querySelector("ol");return l&&(a.children=[],[...l.children].forEach(t=>{a.children.push(r(t,o++))})),a};return{data:a(),index:o}},axSelectToArr=(t,e=0,s=!0)=>{let i=axIdToDom(t),o=e;if(!i)return console.error(axError.notExist),!1;let a=()=>{let t=[];return[...i.children].forEach(e=>{t.push(r(e,o++))}),t},n=(t,e)=>{let s=[...t.attributes].filter(t=>"label"!==t.name&&"value"!==t.name);s.forEach(t=>{["selected","disabled","readonly","active","checked","expanded"].includes(t.name)?e[t.name]=!0:e[t.name]=t.value.trim()})},r=(t,e)=>{let i={id:e,node:t},a=t.textContent.trim(),l=t.hasAttribute("value")?t.getAttribute("value").trim():"";return n(t,i),"OPTGROUP"==t.nodeName?(i.label=t.getAttribute("label").trim(),i.value=i.label,i.children=[],[...t.children].forEach(t=>{i.children.push(r(t,o++))})):(i.label=a||l.trim(),i.value=s?l||i.label:l),i};return{data:a(),index:o}},axTableToJson=t=>{let e=axIdToDom(t),s=e.querySelector("tbody"),i=s.rows,o=[];return[...i].forEach(t=>{let e=t.cells,s=[];[...e].forEach(t=>{s.push(t.innerText.trim())}),o.push(s)}),o},axArrToTree=t=>{let e=t[0].pId;return t.forEach(e=>{let s=t.filter(t=>e.id==t.pId);s.length&&(e.children=s)}),t.filter(t=>t.pId==e)},axGetDoms=t=>{let e=axType(t),s=[],i=t=>{let e,s=axType(t);return"String"===s&&axStrType(t)?e=[...this.targetDom.querySelectorAll(t)]:s.includes("HTML")&&(e=[t]),e};return s="Array"===e?t.map(t=>i(t)).flat(1/0):i(t),s.filter(Boolean)},axFindItem=(t,e,s)=>{let i,o=axType(t),a=Object.assign({string:"label",number:"id",dom:"headerDom"},s),n=(t,e)=>{let s=Object.keys(t),i=e.find(e=>{let i=!0;for(let o of s)if(e[o]!=t[o]){i=!1;break}return i});return i};return i="Object"===o?e.find(e=>e===t)||n(t,e):"Array"===o?e.find(e=>e===t):"Number"===o?e[0].hasOwnProperty(a.number)?e.find(e=>String(e[a.number])===String(t)):e[t]:"String"===o?t.startsWith("#")?e.find(e=>"#"+e[a.dom].id===t):e.find(e=>String(e[a.number])===t||String(e[a.string])===t):!!o.includes("HTML")&&e.find(e=>e[a.dom]===t),i},axTreeMethod={addPath:(t,e=-1,s=0)=>{if(!Array.isArray(t)||0===t.length)return!1;let i=0,o=0,a=!!t[0].hasOwnProperty("id"),n=s,r=(t,s,l=e)=>{t.forEach(t=>{a||(t.id=n,n++),t.floor=s,t.pId=t.pId||0===t.pId?t.pId:e,t.path=l.toString()+">"+t.id.toString(),s>=i&&(i=s),isNaN(t.id)||t.id>=o&&(o=t.id),t.children&&t.children.length>0&&(t.children.forEach(e=>{e.pId=t.id}),r(t.children,s+1,t.path)),t.path||(t.path=t.pId+">"+t.id)})};return r(t,1),{data:t,floorMax:i,idMax:o}},remove:(t,e,s,i)=>{if(1!==t.floor){let s=e.find(e=>e.id==t.pId),i=s.children,o=i.indexOf(t);i.splice(o,1)}else s&&(s=s.filter(e=>e!=t));return e=e.filter(e=>e!==t&&!e.path.includes(">"+t.id+">")),t.wrapperDom.remove(),i&&i(t,e),{flat:e,tree:s}},createData:(t,e,s,i)=>{let o={},a=axType(t),n=axIncreaseId(s),r="String"===a?t:"新节点"+n;if("Object"===a){let s=i?{path:e.path+">"+t.id,floor:e.floor+1}:{path:e.path.replace(new RegExp("(.*)"+e.id),"$1"+t.id),floor:e.floor};!t.hasOwnProperty("id")&&(t.id=n),o=Object.assign(t,s)}else o=i?{id:n,label:r,pId:e.id,path:e.path+">"+n,floor:e.floor+1}:{id:n,label:r,pId:e.pId,path:e.path.replace(new RegExp("(.*)"+e.id),"$1"+n),floor:e.floor};return o},existChildPush:(t,e,s=!0)=>{s?(e.children.unshift(t),e.bodyDom.insertAdjacentElement("afterBegin",t.wrapperDom)):(e.children.push(t),e.bodyDom.insertAdjacentElement("beforeEnd",t.wrapperDom))},noExistChildPush:(t,e,s)=>{e.children=[],e.children.push(t),e=s(e),e.bodyDom.appendChild(t.wrapperDom),e.wrapperDom.appendChild(e.bodyDom)},getItemsFromPath(t){let e=Object.assign({connector:"/",prop:"label"},t),s=e.path.split(">"),i=s.map(t=>e.data.find(e=>e.id==t)).filter(Boolean),o=i.map(t=>t[e.prop]).join(e.connector);return{items:i,path:o}},getFullData:async function(t={}){if(axIsEmpty(t.source))return!1;let e=axType(t.source),s=Object.assign({idStart:0,rootStart:-1,replace:!1,ajaxData:{},ajaxType:"post",async:!1,addPath:!0},t),i=[],o={},a=t=>{let e=t.nodeName,i=[];return"SELECT"===e||"DATALIST"===e?i=axSelectToArr(t,s.idStart,s.replace).data:"UL"!==e&&"OL"!==e||(i=axUlToArr(t,s.idStart,s.replace).data),i},n=t=>{let e=[],s=axClone(t);return e=s[0].hasOwnProperty("pId")&&s[0].hasOwnProperty("id")?axArrToTree(s):s,e};if(!axIsEmpty(s.ajaxData)&&(s.async=!0),s.async){let t=s.source.loadDom?axIdToDom(s.source.loadDom):null;await axAjax({url:s.source,data:axIsEmpty(s.ajaxData)?"":s.ajaxData,type:s.ajaxType,opened:t=>{s.opened?s.opened(t):s.instance&&s.xhrName&&(s.instance[s.xhrName]=t.xhr)},before:e=>{s.before?s.before(e):t&&t.setAttribute("loading","")},success:e=>{if(axIsEmpty(e.content))return console.warn("No data obtained!"),!1;t&&t.hasAttribute("loading")&&t.removeAttribute("loading"),s.success&&s.success(e),i=n(e.content)}})}else e.includes("HTML")?i=a(s.source):"String"===e?axStrType(s.source)&&(i=a(axIdToDom(s.source))):"Array"===e&&(i=n(s.source));return o=s.addPath?this.addPath(i,s.rootStart,s.idStart):i,s.callback&&s.callback(o),o}},axDateMethod={toSlash:function(t){return t.replace("-","/")},toDate:function(t,e){let s,i=axType(t);return"Date"===i?s=new Date(t.valueOf()):"String"===i?s=new Date(this.toSlash(t)):"Object"===i?(s=new Date,t.hasOwnProperty("YYYY")&&s.setFullYear(t.YYYY),t.hasOwnProperty("MM")&&s.setMonth(t.MM),t.hasOwnProperty("DD")&&s.setDate(t.DD),t.hasOwnProperty("hh")&&s.setHours(t.hh),t.hasOwnProperty("mm")&&s.setMinutes(t.mm),t.hasOwnProperty("ss")&&s.setSeconds(t.ss)):s=new Date,"date"===e?(s.setHours(0),s.setMinutes(0),s.setSeconds(0)):"month"===e?(s.setDate(1),s.setHours(0),s.setMinutes(0),s.setSeconds(0)):"year"===e&&(s.setMonth(0),s.setDate(1),s.setHours(0),s.setMinutes(0),s.setSeconds(0)),s},toObj:function(t,e=!1,s){let i,o=axType(t),a="";if("Object"===o)a=t;else if("String"===o&&!t.trim().includes(" ")&&t.includes(":")){let e=t.split(":");a={hh:~~e[0],mm:~~e[1],ss:~~e[2]}}else i=this.toDate(t),a={YYYY:i.getFullYear(),MM:i.getMonth(),DD:i.getDate(),hh:i.getHours(),mm:i.getMinutes(),ss:i.getSeconds()};return e&&(!a.hasOwnProperty("hh")&&(a.hh=0),!a.hasOwnProperty("mm")&&(a.mm=0),!a.hasOwnProperty("ss")&&(a.ss=0)),"year"===s?(Reflect.deleteProperty(a,"MM"),Reflect.deleteProperty(a,"DD"),Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")):"month"===s?(Reflect.deleteProperty(a,"DD"),Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")):"date"===s&&(Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")),a},strToTimeObj:function(t){t=t.replace(" ","");let e=t.split(":");return{hh:~~e[0]||0,mm:~~e[1]||0,ss:~~e[2]||0}},getDays:function(t){let e=this.toDate(t),s=e.getFullYear(),i=e.getMonth();return new Date(s,i+1,0).getDate()},getChain:function(t,e={YYYY:0,MM:0,DD:0,hh:0,mm:0,ss:0}){let s=this.toDate(t);return e.hasOwnProperty("ss")&&s.setDate(s.getSeconds()+e.ss),e.hasOwnProperty("mm")&&s.setDate(s.getMinutes()+e.mm),e.hasOwnProperty("hh")&&s.setDate(s.getHours()+e.hh),e.hasOwnProperty("DD")&&s.setDate(s.getDate()+e.DD),e.hasOwnProperty("MM")&&s.setMonth(s.getMonth()+e.MM),e.hasOwnProperty("YYYY")&&s.setFullYear(s.getFullYear()+e.YYYY),s},fillZero:function(t){let e=~~t;return e<10?"0"+e:e},fillFormat:function(t,e){let s,i,o,a,n,r,l,h=["日","一","二","三","四","五","六"];return t instanceof Date?(s=t.getFullYear(),i=t.getMonth()+1,o=t.getDate(),a=t.getHours(),n=t.getMinutes(),r=t.getSeconds(),l=t.getDay()):(s=t.YYYY,i=t.MM+1,o=t.DD,a=t.hh,n=t.mm,r=t.ss,t.hasOwnProperty("DD")&&(l=new Date(t.YYYY,t.MM,t.DD).getDay())),e.includes("YYYY")&&(e=e.replace("YYYY",s)),e.includes("MM")&&(e=e.replace("MM",this.fillZero(i))),e.includes("DD")&&(e=e.replace("DD",this.fillZero(o))),e.includes("hh")&&(e=e.replace("hh",this.fillZero(a))),e.includes("mm")&&(e=e.replace("mm",this.fillZero(n))),e.includes("ss")&&(e=e.replace("ss",this.fillZero(r))),e.includes("WW")&&void 0!==l&&(e=e.replace("WW",h[l])),e},sort:function(t){return t.sort((t,e)=>this.toDate(t)-this.toDate(e))},trim:function(t){return t.trim().replace(/\s+/gi," ")},getType:function(t){let e="";return RegExp(/^(?=.*YYYY)(?=.*MM)(?=.*DD)(?=.*hh).*$/).test(t)?e="datetime":RegExp(/^(?=.*YYYY)(?=.*MM)(?=.*DD).*$/).test(t)?e="date":RegExp(/^(?=.*YYYY)(?=.*MM).*$/).test(t)?e="month":RegExp(/^(?=.*YYYY).*$/).test(t)?e="year":RegExp(/^(?=.*hh).*$/).test(t)&&(e="time"),e},isSameDay:function(t,e){let s={...t},i={...e};return Reflect.deleteProperty(s,"hh"),Reflect.deleteProperty(s,"mm"),Reflect.deleteProperty(s,"ss"),Reflect.deleteProperty(i,"hh"),Reflect.deleteProperty(i,"mm"),Reflect.deleteProperty(i,"ss"),JSON.stringify(s)==JSON.stringify(i)}},axIsOutside=(t,e,s,i)=>{if(!e)return!0;let o=axIdToDom(e);if(!o)return!0;let a,n,r,l,h=t.clientX,d=t.clientY;return a=s||o.getBoundingClientRect().left,n=i||o.getBoundingClientRect().top,r=a+o.offsetWidth,l=n+o.offsetHeight,hr||dl},axStyle=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t);return document.defaultView.getComputedStyle(s,e)},axListenAnimation=(t={duration:duration,doing:doing,done:done})=>{if(!t.duration)return!1;let e=(new Date).getTime()+t.duration,s=()=>{let i,o=(new Date).getTime();o>=e?(t.done&&t.done(s),i&&cancelAnimationFrame(s)):(t.doing&&t.doing(s),i=requestAnimationFrame(s))};return s(),s},axGetStyleTransform=(t,e=["translate","scale","rotate","skew"],s=!1)=>{let i=axIdToDom(t),o=axStyle(i),a=i.style.transform,n={rotate:0,scale:{x:1,y:1},translate:{x:0,y:0},skew:{x:0,y:0}};if(a){let t=t=>new RegExp(`${t}\\(([^\\)]+)\\)`),s=e=>a.match(t(e));if(e.includes("translate")&&a.includes("translate")&&s("translate"))if(s("translate")[1].includes(",")){let t=s("translate")[1].split(",").map(t=>parseInt(t));n.translate={x:t[0],y:t[1]}}else n.translate={x:parseInt(s("translate")[1]),y:0};if(e.includes("scale")&&a.includes("scale")&&s("scale"))if(s("scale")[1].includes(",")){let t=s("scale")[1].split(",").map(t=>parseFloat(t));n.scale={x:t[0],y:t[1]}}else n.scale={x:parseFloat(s("scale")[1]),y:parseFloat(s("scale")[1])};if(e.includes("rotate")&&a.includes("rotate")&&s("rotate")&&(n.rotate=parseFloat(s("rotate")[1])),e.includes("skew")&&a.includes("skew")&&s("skew"))if(s("skew")[1].includes(",")){let t=s("skew")[1].split(",").map(t=>parseFloat(t));n.skew={x:t[0],y:t[1]}}else n.skew={x:parseFloat(s("skew")[1]),y:0}}return s&&(n.translate={x:parseInt(o.left),y:parseInt(o.top)}),n},axSetStyleTransform=(t,e,s=!1)=>{let i=axIdToDom(t),o=i.style.transform,a=t=>new RegExp(`${t}\\(([^\\)]+)\\)`,"gmi");if(axIsEmpty(e))return!1;for(let t in e)if(e.hasOwnProperty(t)){let n="";"translate"===t?s?isNaN(e[t])?(i.style.left=`${e[t].x}px`,i.style.top=`${e[t].y}px`):i.style.left=`${e[t]}px`:(n=isNaN(e[t])?`${t}(${e[t].x}px,${e[t].y}px)`:`${t}(${e[t]}px)`,o.includes(t)?o.startsWith("translate")?o=o.replace(a(t),n):(o=o.replace(a(t),""),o=`${n} ${o}`):o=`${n} ${o}`):("scale"===t?n=isNaN(e[t])?`${t}(${e[t].x},${e[t].y})`:`${t}(${e[t]})`:"rotate"===t?n=`${t}(${e[t]}deg)`:"skew"===t&&(n=isNaN(e[t])?`${t}(${e[t].x}deg,${e[t].y}deg)`:`${t}(${e[t]}deg)`),o.includes(t)?o=o.replace(a(t),n):o+=` ${n}`)}return i.style.transform=o,o},axTplEngine=(t,e)=>{if(!t)return console.error("No html!"),!1;let s,i=/<#([^#>]+)?#>/g,o=/(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,a="let r=[];\n",n=0,r=(t,e)=>(a+=e?t.match(o)?t+"\n":"r.push("+t+");\n":""!=t?'r.push("'+t.replace(/"/g,'\\"')+'");\n':"",r);for(;s=i.exec(t);)r(t.slice(n,s.index))(s[1],!0),n=s.index+s[0].length;return r(t.substr(n,t.length-n)),a+='return r.join("");',new Function(a.replace(/[\r\t\n]/g,"")).apply(e)},axClone=t=>{let e=t=>{if(null===t)return null;if("object"!=typeof t)return t;if(t.constructor===Date)return new Date(t);{let e={};for(let s in t)if(null==t[s])e[s]=null;else if("object"!=typeof t[s]||t[s].nodeType)e[s]=t[s];else if(e[s]=axClone(t[s]),t[s]instanceof Array){let i=[];for(let e of t[s])i.push(axClone(e));e[s]=i}return e}};return Array.isArray(t)?t.map(t=>e(t)):e(t)},axMerge=(t,e,s={arrAppend:!1,clone:!1,attrAppend:!0})=>{if("object"!=typeof t||"object"!=typeof e)return e;if(!e)return t;let i=s.copy?axClone(t):t;for(let t in e)e.hasOwnProperty(t)&&i.hasOwnProperty(t)?i[t]?"Array"!=axType(e[t])?i[t]=axMerge(i[t],e[t],s):s.arrAppend?i[t].push(...e[t]):i[t]=e[t]:i[t]=e[t]:e.hasOwnProperty(t)&&!i.hasOwnProperty(t)&&s.attrAppend&&(i[t]=e[t]);return i},axStrToArr=(t,e,s)=>{let i=[],o={};return axIsEmpty(e)||e.forEach((t,e)=>{o[t]=axIsEmpty(s)?"":s[e]}),"["==t.substr(0,1)&&"]"==t.substr(-1)?i=JSON.parse(t):-1!=t.replace(/\s*/g,"").indexOf("},{")?i=JSON.parse("["+t+"]"):"{"==t.replace(/\s*/g,"").substr(0,1)&&"}"==t.replace(/\s*/g,"").substr(-1)?i=JSON.parse("["+t+"]"):(i=t.split(","),i.forEach((t,s)=>{if(t=t.trim(),"string"==typeof t&&!axIsEmpty(e)){let o={};e.forEach((e,s)=>{o[e]=0==s?t:""}),i.splice(s,1,o)}})),i.forEach(t=>{if(!axIsEmpty(o))for(let e in o)t.hasOwnProperty(e)?t.hasOwnProperty(e)&&!t[e]&&(t[e]=o[e]):t[e]=o[e]?o[e]:""}),i},axTplToArr=(t,e,s,i,o)=>{let a=axIdToDom(t),n=[];if(i){let t=a.querySelectorAll(i);t.forEach(t=>{let i={};e.forEach((e,a)=>{let n=t.querySelector("["+e+"]");i[s[a]]=n?n.getAttribute(e)?n.getAttribute(e).trim():n.innerHTML.trim():o[a]||""}),n.push(i)})}else{let t={};e.forEach((e,i)=>{let n=a.querySelector("["+e+"]");t[s[i]]=n?n.getAttribute(e)?n.getAttribute(e).trim():n.innerHTML.trim():o[i]||""}),n.push(t)}return n},axDataset=(t,e)=>{let s=t?axIdToDom(t):null,i=/^\d+(\.\d+)?$/,o=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;if(s){let t=[...s.attributes].filter(t=>0==t.name.indexOf("data-"));if(!axIsEmpty(t)){let s=axClone(e),a=t=>{for(let e in t){let s=e.toLowerCase();t[s]=t[e],"Object"===axType(t[e])&&a(t[e]),s!=e&&delete t[e]}};a(s);for(let e=0;e{for(let s in t){let i=s.toLowerCase();"Object"===axType(t[s])?n(t[s],e[i]):t[s]=e[i]}};n(e,s)}}return e},axAttrToJson=(t,e)=>{let s=axIdToDom(t);if(!s)return console.warn("The attribute node does not exist!"),{};let i=s.getAttribute(e);if(!e||!i)return{};if(!i.includes(":"))return{};let o=i.trim();return o.startsWith("{")||(o="{"+o+"}"),new Function("return "+o)()},axExtend=(t,e,s,i)=>{if(!t)return console.error(axError.notExist),!1;let o=s?axIdToDom(s):null;return axMerge(t,e),o&&axMerge(t,axAttrToJson(o,i)),t},axAddPlan=(t,e,s)=>{let i=axType(t),o=[],a=t=>{s.handlers.hasOwnProperty(t)||(s.handlers[t]=[]);let i=e.toString().replace(/\s/g,"").replace(/\;/g,"").match(/{(\S*)}/)[1],o=s.handlers[t].toString().replace(/\s/g,"").replace(/\;/g,"");!(o.indexOf(i)>-1)&&s.handlers[t].push(e)};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axExePlan=(t,e,...s)=>{let i=axType(t),o=[],a=t=>{if(!e.handlers.hasOwnProperty(t))return console.warn(`The ${t} event is unregistered or unusable!`);e.handlers[t].forEach(t=>{t.call(e,...s)})};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axDelPlan=(t,e,s)=>{let i=axType(t),o=[],a=t=>{if(!s.handlers.hasOwnProperty(t))return console.warn(`The ${t} event is invalid or unusable!`);if(e){let i=s.handlers[t].findIndex(t=>t===e);if(void 0===i)return console.warn(`The ${t} event is not bound!`);s.handlers[t].splice(i,1),0===s.handlers[t].length&&delete s.handlers[t]}else delete s.handlers[t]};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axAddElem=(t,e,s)=>{let i=t.toLowerCase().trim(),o=document.createElement(i),a=function(t,e){if(""===e||null==e)return!1;"template"===i?t.innerHTML=e:Array.isArray(e)?e.length>0&&e.forEach(e=>{a(t,e)}):"object"==typeof e?t.appendChild(e):t.insertAdjacentHTML("beforeEnd",e)};if(e)for(let t in e)e.hasOwnProperty(t)&&o.setAttribute(t,e[t]);return a(o,s),o},axStrToFilter=(t,e,s)=>{let i=`source.filter(item =>${t})`,o=new Function("source","return "+i)(e);return s&&s(o),o},axRangeReplace=(t,e,s,i,o)=>{"string"!=typeof t&&(t=JSON.stringify(t)),"string"!=typeof e&&(t=JSON.stringify(e));let a="";return a=s||i?i?s?t.substring(0,s)+e+t.substring(i):o?t.substring(i-o)+e+t.substring(0,s):e+t.substring(i):o?t.substring(0,s)+e+t.substring(s+o):t.substring(0,s)+e:e,a},axArrange=(t,e,s=0,i=[],o=[])=>{let a=t.length;if(!(s+e>a)){for(let n=s;n{if(!t)return console.error("There is no options!"),!1;let i=axAddElem("SPAN",{"ajax-message":""}),o=e?axIdToDom(e):null;o&&o.appendChild(i);let a={url:"",selector:"",type:"post",async:!0,data:{},delay:6e4,contentType:"",headers:{},responseType:"",catchable:!1,abort:()=>{o?(i.innerHTML='中止了请求!',o.setAttribute("ajax-result","abort")):console.error("中止了请求!")},timeout:()=>{o?(i.innerHTML='请求超时了!',o.setAttribute("ajax-result","timeout")):console.error("请求超时了!")},loading:'',opened:"",before:t=>{o&&(i.innerHTML=t.content,o.setAttribute("ajax-result","before"))},downloading:()=>{},uploading:()=>{},success:t=>{o&&(o.innerHTML=t.content,o.setAttribute("ajax-result","success"))},error:t=>{o?(i.innerHTML=`错误状态:${t.status}`,o.setAttribute("ajax-result","error")):console.error(`错误状态:${t.status}`)}};for(let e in t)a[e]=t[e];let n="";n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");let r="";if(!axIsEmpty(a.data))if("FormData"==axType(a.data))r=a.data;else if("Object"==axType(a.data))if(a.contentType.includes("json"))r=JSON.stringify(a.data);else{for(let t in a.data)r+="&"+t+"="+a.data[t];a.contentType="application/x-www-form-urlencoded"}else a.data=a.data.trim(),r=a.data.startsWith("&")?a.data.slice(1):a.data,a.contentType="application/x-www-form-urlencoded";if(a.headers["Content-Type"]=a.contentType,!a.contentType.includes("urlencoded")&&"get"==a.type.toLowerCase())return console.error("Please request data with post!"),!1;let l,h=()=>{for(let t in a.headers)a.headers[t]&&n.setRequestHeader(t,a.headers[t])};n.timeout=a.delay,n.responseType=a.responseType;let d=()=>{l&&n.removeEventListener("timeout",l),n.abort(),!axIsEmpty(a.abort)&&a.abort(o,n)},p=new Promise((t,e)=>{let i=(t,e)=>{let s=t.loaded,i=t.total,a=0,n=0,r="0%",l=new Date(t.timeStamp).getTime();t.lengthComputable&&(a=s/i,n=Math.round(100*a),r=n+"%",e&&e({result:r,percent:n,current:s,total:i,ratio:a,time:l,dom:o}))};n.upload.onprogress=(t=>{i(t,t=>{!axIsEmpty(a.uploading)&&a.uploading(t)})}),n.onprogress=(t=>{i(t,t=>{!axIsEmpty(a.downloading)&&a.downloading(t)})}),n.onerror=(t=>{let s={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.error)&&a.error(s),a.catchable&&e(s)}),l=(()=>{let t={content:n.response,status:n.status,dom:o,xhr:n};o&&o.setAttribute("ajax-result","timeout"),!axIsEmpty(a.timeout)&&a.timeout(t),a.catchable&&e(t)}),n.addEventListener("timeout",l),n.onreadystatechange=function(){if(n.readyState<4){let t={content:a.loading,status:n.status,dom:o,xhr:n,abort:d};1===n.readyState&&!axIsEmpty(a.opened)&&a.opened(t),!axIsEmpty(a.before)&&a.before(t),s&&s(t)}else if(n.status>=200&&n.status<300||304==n.status)if(a.responseType&&"text"!=n.responseType){o&&o.setAttribute("ajax-result","success");let e={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.success)&&a.success(e),t(e)}else{let e=document.createElement("div"),s="",i=/()<[^<]*)*<\/head>)|(<\/?html.*?>)|(<\!DOCTYPE.*?html.*?>)|(<\/?body.*?>)/gi,r=axStrEnd(a.url,"#"),l=a.selector||r;e.innerHTML=n.responseText,l&&e.querySelector(l)?s=e.querySelector(l).innerHTML:l&&!e.querySelector(l)?(console.warn(`The node of "${l}" is not exist!`),s=n.responseText.replace(i,"").trim()):s="{"==n.responseText.trim().substr(0,1)||"["==n.responseText.trim().substr(0,1)?JSON.parse(n.responseText.trim()):n.responseText.replace(i,"").trim(),o&&o.setAttribute("ajax-result","success");let h={content:s,status:n.status,dom:o,xhr:n};!axIsEmpty(a.success)&&a.success(h),t(h)}else{let t={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.error)&&a.error(t),a.catchable&&e(t)}},"get"==a.type.toLowerCase()?(n.open("get",a.url+"?now="+(new Date).getTime()+"&"+r,a.async),h(),n.send()):"post"==a.type.toLowerCase()&&(n.open("post",a.url,a.async),h(),n.send(r))});return p.xhr=n,p.abort=d,p},axAjaxSubmit=(t,e,s,i={type:type,success:success,loading:loading,delay:delay,before:before,error:error,opended:opended,other:other})=>{if(!t)return console.error("Url is required!"),!1;if(!e)return console.error("Form node is required!"),!1;i.type=i.type||"post",i.other=i.other||{};let o=axIdToDom(e),a=s?axIdToDom(s):null,n=a?a.innerHTML:"",r=i.loading||"button",l=Object.assign(i.other,{formClass:"ax-form-submitting",buttonClass:"ax-button-submitting",buttonText:"正在提交",overlayClass:"ax-form-overlay",overlayShowClass:"ax-show",successText:"恭喜!提交成功!",errorText:"对不起,提交失败!"}),h=o.querySelector(".ax-form-overlay")?o.querySelector(".ax-form-overlay"):axAddElem("div",{class:"ax-form-overlay"});if(o.classList.contains(l.formClass))return!1;if(a&&a.classList.contains(l.buttonClass))return!1;let d,p={};return o.querySelectorAll("[name]").forEach(function(t){p[t.getAttribute("name")]=t.value.trim()}),d=axAjax({url:t,data:p,type:i.type,opened:t=>{i.opened&&i.opened(t)},before:t=>{o.classList.add(l.formClass), +"use strict";const axError={formatError:"This is not a valid data format!",paraError:"The parameters do not meet the requirements!",arrayRequired:"The value must be an array type!",noNode:"This page can not find the node!",required:"Required field is missing!",notExist:"The program cannot be executed because the object does not exist!"},axIsMobi=()=>"ontouchstart"in document.documentElement,axEventMap=axIsMobi()?["touchstart","touchmove","touchend","touchcancel"]:["mousedown","mousemove","mouseup","mouseleave"],axIsDate=t=>isNaN(t)&&!isNaN(Date.parse(t)),axCeil={phone:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-phone")),pad:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pad")),flip:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-flip")),pro:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pro")),pc:parseInt(getComputedStyle(document.documentElement).getPropertyValue("--ceil-pc"))},axClient=()=>{let t=document.body.clientWidth;return taxCeil.phone&&taxCeil.pad&&taxCeil.flip&&tObject.prototype.toString.call(t).slice(8,-1),axIsEmpty=t=>{let e=axType(t);return!t||("Function"===e?"{}"==t.toString().replace(/\s+/g,"").match(/{.*}/g)[0]:"Array"===e?""==t.join(""):"Object"===e&&0===Object.keys(t).length)},axToNumber=t=>isNaN(t)?parseFloat(t):t,axTheme={set:(t,e="")=>{if(axIsEmpty(t))return!1;let s=t=>{t=t.trim();let e=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,s=t.toLowerCase(),i=[];if(e.test(s)){if(4===s.length){let t="#";for(let e=1;e<4;e+=1)t+=s.slice(e,e+1).concat(s.slice(e,e+1));s=t}for(let t=1;t<7;t+=2)i.push(parseInt("0x"+s.slice(t,t+2)))}return i},i=t=>{let e,s,i=t[0]/255,o=t[1]/255,a=t[2]/255,n=Math.min(i,o,a),r=Math.max(i,o,a),l=(n+r)/2,h=r-n;if(r===n)e=0,s=0;else{switch(s=l>.5?h/(2-r-n):h/(r+n),r){case i:e=(o-a)/h+(o{let e=axType(t),o=[];if(!axIsEmpty(t))if("String"===e)if(t=t.trim().toLowerCase(),t.startsWith("hsl"))o=t.replace(/^(hsl|hsla)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",");else{let e=[];t.startsWith("#")?e=s(t):t.startsWith("rgb")&&(e=t.replace(/^(rgb|rgba)\(/,"").replace(/\)$/,"").replace(/\s/g,"").split(",").map(Number)),o=i(e)}else"Array"===e&&(o=t);return 3===o.length&&o.push(1),o},a=axType(t),n={primary:[],text:[],error:[],success:[],info:[],warning:[],question:[]};if("Object"===a)for(let e in t)t.hasOwnProperty(e)&&t[e].length>2&&(n[e]=o(t[e]));else n.primary=o(t);axIsEmpty(axLocalStorage.get("ax-theme-raw"))&&axLocalStorage.set("ax-theme-raw",axGetColors());let r=document.querySelector(":root");for(let t in n)n.hasOwnProperty(t)&&n[t].length>2&&(r.style.setProperty(`--h-${t}`,n[t][0]),r.style.setProperty(`--s-${t}`,"string"==typeof n[t][1]&&n[t][1].includes("%")?n[t][1]:n[t][1]+"%"),r.style.setProperty(`--l-${t}`,"string"==typeof n[t][2]&&n[t][2].includes("%")?n[t][2]:n[t][2]+"%"),r.style.setProperty(`--a-${t}`,n[t][3]));e&&axLocalStorage.set(e,n)},get:()=>axGetColors(),reset:()=>{}};axTheme.reset=(()=>{let t=axLocalStorage.get("ax-theme-raw");axTheme.set(t)});const axGetScrollObj=()=>navigator.userAgent.indexOf("Firefox")>0?{event:"DOMMouseScroll",detail:"detail"}:{event:"mousewheel",detail:"wheelDelta"},axGetClientObj=t=>{let e=axIsMobi()?t.targetTouches[0]:t;return e?{x:e.clientX,y:e.clientY}:null},axIsScrollUp=(t,e=axGetScrollObj().detail)=>{let s,i=t[e];return s=navigator.userAgent.indexOf("Firefox")>0?i>0:i<0,s},axIsVnode=t=>!getComputedStyle(t).display,axNumber=(t,e)=>{let s=Object.assign({places:2,mode:"round",zero:!1},e),i=0;if(!t||!Number(t))return 0;{let e=Number(t),o=e+Number.EPSILON,a=Number(`1${"0".repeat(s.places)}`),n=e*a,r=o*a;i="floor"===s.mode?Math.floor(n)/a:"ceil"===s.mode?Math.ceil(n)/a:Math.round(r)/a}return s.zero&&(i=i.toFixed(s.places)),i},axTrim=(t,e=!1)=>e?t.replace(/\s+/g,""):t.trim().replace(/\s+/gi," "),axSplitToArr=(t,e=",",s="all")=>{let i=axType(t),o="",a=[];return"String"===i?(o="one"===s?axTrim(t,!1):"none"===s?axTrim(t,!0):t.trim(),a=o.split(e)):"Array"===i&&(a=t),a},axPreventDefault=t=>{t.preventDefault?t.preventDefault():t.returnValue=!1},axStrEnd=(t,e,s="afterend",i=!0)=>{if(!t||!e)return!1;if(t=t.trim(),t.includes(e)){let o,a,n=e.length;return"beforebegin"===s?(o=t.indexOf(e),i&&(o+=n),a=t.substring(0,o)):"afterbegin"===s?(o=t.indexOf(e),!i&&(o+=n),a=t.substring(o,t.length)):"beforeend"===s?(o=t.lastIndexOf(e),i&&(o+=n),a=t.substring(0,o)):"afterend"===s?(o=t.lastIndexOf(e),!i&&(o+=n),a=t.substring(o,t.length)):a="",a}return""},axStrType=t=>{if("string"!=typeof t)return console.error("Argument must be a string!"),!1;t=t.trim();let e=t=>{if(t>="A"&&t<="Z")return!0},s="";return t&&(t.includes(" ")?s="level":t.startsWith("#")?s="id":t.startsWith(".")?s="class":t.startsWith("[")&&t.endsWith("]")?s="name":(["H1","H2","H3","H4","H5","H6"].includes(t)||[...t].every(t=>e(t)))&&(s="node")),s},axStrToDom=t=>{if("string"!=typeof t)return!1;let e;return t=t.trim(),t.startsWith("")?(e=document.createElement("tr"),e.innerHTML=t,e):(e=document.createElement("div"),e.innerHTML=t,e.firstElementChild)},axIdToDom=t=>{let e=axType(t);if(t){if("String"===e){let e=t.trim();return axStrType(e)?("name"!==axStrType(e)||e.includes("=")||(e=e.slice(0,1)+"name="+e.slice(1)),document.querySelector(e)):(console.warn("No node is found with this string!"),!1)}return!!e.includes("HTML")&&t}return console.warn("Node selector is empty!"),!1},axAllToDoms=t=>{if(axIsEmpty(t))return[];let e=[],s=axType(t);if(s.includes("HTML"))e.push(t);else if("String"===s){let s=axTrim(t),i=",";s.includes(" ")&&(i=" "),s.split(i).forEach(t=>{let s=axIdToDom(t);s&&e.push(s)})}else"Array"===s?t.forEach(t=>{let s=axIdToDom(t);s&&e.push(s)}):"NodeList"===s&&(e=[...t]);return e},axValueToArr=t=>{let e=[];if(!axIsEmpty(t)||0===t)if(Array.isArray(t))e=t;else if("string"==typeof t){let s=t.trim(),i=t.includes(",")?",":" ";s.includes(i)?e=s.split(i):e.push(t)}else e.push(t);return e},axUnique=(t,e)=>{if(e){let s=new Map;for(let i of t)s.has(i[e])||s.set(i[e],i);return[...s.values()]}return[...new Set(t)]},axClass={get:function(t){return axValueToArr(t)},add:function(t,e,s){let i=axIdToDom(t),o=this.get(e);return!(!i||0===o.length)&&(o.forEach(t=>{let e=!s||s(t);e&&i.classList.add(t)}),this)},del:function(t,e,s){let i=axIdToDom(t),o=this.get(e);return!(!i||0===o.length)&&(o.forEach(t=>{let e=!s||s(t);e&&i.classList.remove(t)}),this)}},axArrToDom=(t,e)=>{let s=t.split(","),i=[],o=/^[0-9]*$/,a="";return a="string"==typeof e?document.querySelector(e):e,s.forEach(t=>{if(!o.test(t.substr(0,1)))if("class"==axStrType(t))i=a?i.concat([...a.querySelectorAll(t)]):i.concat([...document.querySelectorAll(t)]);else if("id"==axStrType(t))i.push(document.querySelector(t));else{if(!t)return i;{let e=document.querySelectorAll(t);e&&(i=a?i.concat([...a.querySelectorAll(t)]):i.concat([...document.querySelectorAll(t)]))}}}),i},axArrToFlat=t=>{let e=[],s=[...t];return s.forEach(t=>{t.children?e=[...e,t,...axArrToFlat(t.children)]:e.push(t)}),e},axIncreaseId=(t,e=!0)=>{let s,i=[];return e?(t.forEach(t=>{i.push(~~t.id)}),s=Math.max(...i)+1):s=t.length,s},axMultiValues=(t,e="checkbox",s="array",i,o=",")=>{let a,n=[],r=i?axIdToDom(i):"";if("NodeList"==axType(t)||"Array"==axType(t)){if(e.includes("select")||"file"==e)return console.warn("Can not be an node array in this type!"),!1;a=t}else if("object"==typeof t||axStrType(t)&&"name"!==axStrType(t)){let s=axIdToDom(t);e.includes("select")||"SELECT"==t.nodeName?(e="select",a=s.options):"file"==e||"file"==s.type?(e="file",a=[s]):a=[...s.querySelectorAll("input")]}else{let s="";s="name"===axStrType(t)?t.replace("[","[name="):`[name=${t}]`,a=e.includes("select")?r?r.querySelector(s).options:document.querySelector(s).options:"file"==e?r?[r.querySelector(s)]:[document.querySelector(s)]:r?[...r.querySelectorAll(s)]:[...document.querySelectorAll(s)]}for(let t=0;t{let i=null,o=function(o){s&&(o.stopPropagation(),o.preventDefault()),i&&clearTimeout(i),i=setTimeout(()=>{t.apply(this,arguments)},e)};return o.cancel=function(){i&&clearTimeout(i)},o},axThrottle=(t,e=500,s=!1)=>{let i=0,o=null,a=function(a){let n=(new Date).getTime();n-i>e?(o&&(clearTimeout(o),o=null),t.apply(this,arguments),i=n):s&&(a.stopPropagation(),a.preventDefault())};return a.cancel=function(){clearTimeout(o),o=null},a},axMoveArr=(t,e,s)=>{if(e>t.length||s>t.length||e<0||s<0)return console.error("Exceeded array length!"),!1;let i=t[e];return t.splice(e,1),t.splice(s,0,i),t},axIsVisible=t=>{let e=axIdToDom(t),s=!0,i="none"!=getComputedStyle(e).display&&"hidden"!=getComputedStyle(e).visibility;for(;s&&i;)e=e.parentNode,e&&e!=document.body?i="none"!=getComputedStyle(e).display&&"hidden"!=getComputedStyle(e).visibility:s=!1;return i},axClampValue=(t={value:value,min:min,max:max})=>t.hasOwnProperty("min")&&t.hasOwnProperty("max")?(t.value=axToNumber(t.value),t.min=axToNumber(t.min),t.max=axToNumber(t.max),t.value>t.max?t.max:t.value{let s=axIdToDom(e),i=axIdToDom(t),o=s.scrollTop,a=s.getBoundingClientRect().height;return i.offsetTop+i.offsetHeight>o&&i.offsetTop{let i=axIdToDom(t),o=e;if(!t)return console.error(axError.notExist),!1;let a=()=>{let t=[];return[...i.children].forEach(e=>{t.push(r(e,o++))}),t},n=(t,e)=>{let s=[...t.attributes].filter(t=>"label"!==t.name&&"value"!==t.name);s.forEach(t=>{["selected","disabled","readonly","active","checked","expanded"].includes(t.name)?e[t.name]=!0:e[t.name]=t.value.trim()})},r=(t,e)=>{let i=t.firstElementChild,a={id:e,node:i};a.label=i.textContent.trim(),s?a.value=i.hasAttribute("value")?i.getAttribute("value"):a.label:i.hasAttribute("value")&&(a.value=i.getAttribute("value")),n(i,a);let l=t.querySelector("ul")||t.querySelector("ol");return l&&(a.children=[],[...l.children].forEach(t=>{a.children.push(r(t,o++))})),a};return{data:a(),index:o}},axSelectToArr=(t,e=0,s=!0)=>{let i=axIdToDom(t),o=e;if(!i)return console.error(axError.notExist),!1;let a=()=>{let t=[];return[...i.children].forEach(e=>{t.push(r(e,o++))}),t},n=(t,e)=>{let s=[...t.attributes].filter(t=>"label"!==t.name&&"value"!==t.name);s.forEach(t=>{["selected","disabled","readonly","active","checked","expanded"].includes(t.name)?e[t.name]=!0:e[t.name]=t.value.trim()})},r=(t,e)=>{let i={id:e,node:t},a=t.textContent.trim(),l=t.hasAttribute("value")?t.getAttribute("value").trim():"";return n(t,i),"OPTGROUP"==t.nodeName?(i.label=t.getAttribute("label").trim(),i.value=i.label,i.children=[],[...t.children].forEach(t=>{i.children.push(r(t,o++))})):(i.label=a||l.trim(),i.value=s?l||i.label:l),i};return{data:a(),index:o}},axTableToJson=t=>{let e=axIdToDom(t),s=e.querySelector("tbody"),i=s.rows,o=[];return[...i].forEach(t=>{let e=t.cells,s=[];[...e].forEach(t=>{s.push(t.innerText.trim())}),o.push(s)}),o},axArrToTree=t=>{let e=t[0].pId;return t.forEach(e=>{let s=t.filter(t=>e.id==t.pId);s.length&&(e.children=s)}),t.filter(t=>t.pId==e)},axGetDoms=t=>{let e=axType(t),s=[],i=t=>{let e,s=axType(t);return"String"===s&&axStrType(t)?e=[...this.targetDom.querySelectorAll(t)]:s.includes("HTML")&&(e=[t]),e};return s="Array"===e?t.map(t=>i(t)).flat(1/0):i(t),s.filter(Boolean)},axFindItem=(t,e,s)=>{let i,o=axType(t),a=Object.assign({string:"label",number:"id",dom:"headerDom"},s),n=(t,e)=>{let s=Object.keys(t),i=e.find(e=>{let i=!0;for(let o of s)if(e[o]!=t[o]){i=!1;break}return i});return i};return i="Object"===o?e.find(e=>e===t)||n(t,e):"Array"===o?e.find(e=>e===t):"Number"===o?e[0].hasOwnProperty(a.number)?e.find(e=>String(e[a.number])===String(t)):e[t]:"String"===o?t.startsWith("#")?e.find(e=>"#"+e[a.dom].id===t):e.find(e=>String(e[a.number])===t||String(e[a.string])===t):!!o.includes("HTML")&&e.find(e=>e[a.dom]===t),i},axTreeMethod={addPath:(t,e=-1,s=0)=>{if(!Array.isArray(t)||0===t.length)return!1;let i=0,o=0,a=!!t[0].hasOwnProperty("id"),n=s,r=(t,s,l=e)=>{t.forEach(t=>{a||(t.id=n,n++),t.floor=s,t.pId=t.pId||0===t.pId?t.pId:e,t.path=l.toString()+">"+t.id.toString(),s>=i&&(i=s),isNaN(t.id)||t.id>=o&&(o=t.id),t.children&&t.children.length>0&&(t.children.forEach(e=>{e.pId=t.id}),r(t.children,s+1,t.path)),t.path||(t.path=t.pId+">"+t.id)})};return r(t,1),{data:t,floorMax:i,idMax:o}},remove:(t,e,s,i)=>{if(1!==t.floor){let s=e.find(e=>e.id==t.pId),i=s.children,o=i.indexOf(t);i.splice(o,1)}else s&&(s=s.filter(e=>e!=t));return e=e.filter(e=>e!==t&&!e.path.includes(">"+t.id+">")),t.wrapperDom.remove(),i&&i(t,e),{flat:e,tree:s}},createData:(t,e,s,i)=>{let o={},a=axType(t),n=axIncreaseId(s),r="String"===a?t:"新节点"+n;if("Object"===a){let s=i?{path:e.path+">"+t.id,floor:e.floor+1}:{path:e.path.replace(new RegExp("(.*)"+e.id),"$1"+t.id),floor:e.floor};!t.hasOwnProperty("id")&&(t.id=n),o=Object.assign(t,s)}else o=i?{id:n,label:r,pId:e.id,path:e.path+">"+n,floor:e.floor+1}:{id:n,label:r,pId:e.pId,path:e.path.replace(new RegExp("(.*)"+e.id),"$1"+n),floor:e.floor};return o},existChildPush:(t,e,s=!0)=>{s?(e.children.unshift(t),e.bodyDom.insertAdjacentElement("afterBegin",t.wrapperDom)):(e.children.push(t),e.bodyDom.insertAdjacentElement("beforeEnd",t.wrapperDom))},noExistChildPush:(t,e,s)=>{e.children=[],e.children.push(t),e=s(e),e.bodyDom.appendChild(t.wrapperDom),e.wrapperDom.appendChild(e.bodyDom)},getItemsFromPath(t){let e=Object.assign({connector:"/",prop:"label"},t),s=e.path.split(">"),i=s.map(t=>e.data.find(e=>e.id==t)).filter(Boolean),o=i.map(t=>t[e.prop]).join(e.connector);return{items:i,path:o}},getFullData:async function(t={}){if(axIsEmpty(t.source))return!1;let e=axType(t.source),s=Object.assign({idStart:0,rootStart:-1,replace:!1,ajaxData:{},ajaxType:"post",async:!1,addPath:!0},t),i=[],o={},a=t=>{let e=t.nodeName,i=[];return"SELECT"===e||"DATALIST"===e?i=axSelectToArr(t,s.idStart,s.replace).data:"UL"!==e&&"OL"!==e||(i=axUlToArr(t,s.idStart,s.replace).data),i},n=t=>{let e=[],s=axClone(t);return e=s[0].hasOwnProperty("pId")&&s[0].hasOwnProperty("id")?axArrToTree(s):s,e};if(!axIsEmpty(s.ajaxData)&&(s.async=!0),s.async){let t=s.source.loadDom?axIdToDom(s.source.loadDom):null;await axAjax({url:s.source,data:axIsEmpty(s.ajaxData)?"":s.ajaxData,type:s.ajaxType,opened:t=>{s.opened?s.opened(t):s.instance&&s.xhrName&&(s.instance[s.xhrName]=t.xhr)},before:e=>{s.before?s.before(e):t&&t.setAttribute("loading","")},success:e=>{if(axIsEmpty(e.content))return console.warn("No data obtained!"),!1;t&&t.hasAttribute("loading")&&t.removeAttribute("loading"),s.success&&s.success(e),i=n(e.content)}})}else e.includes("HTML")?i=a(s.source):"String"===e?axStrType(s.source)&&(i=a(axIdToDom(s.source))):"Array"===e&&(i=n(s.source));return o=s.addPath?this.addPath(i,s.rootStart,s.idStart):i,s.callback&&s.callback(o),o}},axDateMethod={toSlash:function(t){return t.replace("-","/")},toDate:function(t,e){let s,i=axType(t);return"Date"===i?s=new Date(t.valueOf()):"String"===i?s=new Date(this.toSlash(t)):"Object"===i?(s=new Date,t.hasOwnProperty("YYYY")&&s.setFullYear(t.YYYY),t.hasOwnProperty("MM")&&s.setMonth(t.MM),t.hasOwnProperty("DD")&&s.setDate(t.DD),t.hasOwnProperty("hh")&&s.setHours(t.hh),t.hasOwnProperty("mm")&&s.setMinutes(t.mm),t.hasOwnProperty("ss")&&s.setSeconds(t.ss)):s=new Date,"date"===e?(s.setHours(0),s.setMinutes(0),s.setSeconds(0)):"month"===e?(s.setDate(1),s.setHours(0),s.setMinutes(0),s.setSeconds(0)):"year"===e&&(s.setMonth(0),s.setDate(1),s.setHours(0),s.setMinutes(0),s.setSeconds(0)),s},toObj:function(t,e=!1,s){let i,o=axType(t),a="";if("Object"===o)a=t;else if("String"===o&&!t.trim().includes(" ")&&t.includes(":")){let e=t.split(":");a={hh:~~e[0],mm:~~e[1],ss:~~e[2]}}else i=this.toDate(t),a={YYYY:i.getFullYear(),MM:i.getMonth(),DD:i.getDate(),hh:i.getHours(),mm:i.getMinutes(),ss:i.getSeconds()};return e&&(!a.hasOwnProperty("hh")&&(a.hh=0),!a.hasOwnProperty("mm")&&(a.mm=0),!a.hasOwnProperty("ss")&&(a.ss=0)),"year"===s?(Reflect.deleteProperty(a,"MM"),Reflect.deleteProperty(a,"DD"),Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")):"month"===s?(Reflect.deleteProperty(a,"DD"),Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")):"date"===s&&(Reflect.deleteProperty(a,"hh"),Reflect.deleteProperty(a,"mm"),Reflect.deleteProperty(a,"ss")),a},strToTimeObj:function(t){t=t.replace(" ","");let e=t.split(":");return{hh:~~e[0]||0,mm:~~e[1]||0,ss:~~e[2]||0}},getDays:function(t){let e=this.toDate(t),s=e.getFullYear(),i=e.getMonth();return new Date(s,i+1,0).getDate()},getChain:function(t,e={YYYY:0,MM:0,DD:0,hh:0,mm:0,ss:0}){let s=this.toDate(t);return e.hasOwnProperty("ss")&&s.setDate(s.getSeconds()+e.ss),e.hasOwnProperty("mm")&&s.setDate(s.getMinutes()+e.mm),e.hasOwnProperty("hh")&&s.setDate(s.getHours()+e.hh),e.hasOwnProperty("DD")&&s.setDate(s.getDate()+e.DD),e.hasOwnProperty("MM")&&s.setMonth(s.getMonth()+e.MM),e.hasOwnProperty("YYYY")&&s.setFullYear(s.getFullYear()+e.YYYY),s},fillZero:function(t){let e=~~t;return e<10?"0"+e:e},fillFormat:function(t,e){let s,i,o,a,n,r,l,h=["日","一","二","三","四","五","六"];return t instanceof Date?(s=t.getFullYear(),i=t.getMonth()+1,o=t.getDate(),a=t.getHours(),n=t.getMinutes(),r=t.getSeconds(),l=t.getDay()):(s=t.YYYY,i=t.MM+1,o=t.DD,a=t.hh,n=t.mm,r=t.ss,t.hasOwnProperty("DD")&&(l=new Date(t.YYYY,t.MM,t.DD).getDay())),e.includes("YYYY")&&(e=e.replace("YYYY",s)),e.includes("MM")&&(e=e.replace("MM",this.fillZero(i))),e.includes("DD")&&(e=e.replace("DD",this.fillZero(o))),e.includes("hh")&&(e=e.replace("hh",this.fillZero(a))),e.includes("mm")&&(e=e.replace("mm",this.fillZero(n))),e.includes("ss")&&(e=e.replace("ss",this.fillZero(r))),e.includes("WW")&&void 0!==l&&(e=e.replace("WW",h[l])),e},sort:function(t){return t.sort((t,e)=>this.toDate(t)-this.toDate(e))},trim:function(t){return t.trim().replace(/\s+/gi," ")},getType:function(t){let e="";return RegExp(/^(?=.*YYYY)(?=.*MM)(?=.*DD)(?=.*hh).*$/).test(t)?e="datetime":RegExp(/^(?=.*YYYY)(?=.*MM)(?=.*DD).*$/).test(t)?e="date":RegExp(/^(?=.*YYYY)(?=.*MM).*$/).test(t)?e="month":RegExp(/^(?=.*YYYY).*$/).test(t)?e="year":RegExp(/^(?=.*hh).*$/).test(t)&&(e="time"),e},isSameDay:function(t,e){let s={...t},i={...e};return Reflect.deleteProperty(s,"hh"),Reflect.deleteProperty(s,"mm"),Reflect.deleteProperty(s,"ss"),Reflect.deleteProperty(i,"hh"),Reflect.deleteProperty(i,"mm"),Reflect.deleteProperty(i,"ss"),JSON.stringify(s)==JSON.stringify(i)}},axIsOutside=(t,e,s,i)=>{if(!e)return!0;let o=axIdToDom(e);if(!o)return!0;let a,n,r,l,h=t.clientX,d=t.clientY;return a=s||o.getBoundingClientRect().left,n=i||o.getBoundingClientRect().top,r=a+o.offsetWidth,l=n+o.offsetHeight,hr||dl},axStyle=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t);return document.defaultView.getComputedStyle(s,e)},axListenAnimation=(t={duration:duration,doing:doing,done:done})=>{if(!t.duration)return!1;let e=(new Date).getTime()+t.duration,s=()=>{let i,o=(new Date).getTime();o>=e?(t.done&&t.done(s),i&&cancelAnimationFrame(s)):(t.doing&&t.doing(s),i=requestAnimationFrame(s))};return s(),s},axGetStyleTransform=(t,e=["translate","scale","rotate","skew"],s=!1)=>{let i=axIdToDom(t),o=axStyle(i),a=i.style.transform,n={rotate:0,scale:{x:1,y:1},translate:{x:0,y:0},skew:{x:0,y:0}};if(a){let t=t=>new RegExp(`${t}\\(([^\\)]+)\\)`),s=e=>a.match(t(e));if(e.includes("translate")&&a.includes("translate")&&s("translate"))if(s("translate")[1].includes(",")){let t=s("translate")[1].split(",").map(t=>parseInt(t));n.translate={x:t[0],y:t[1]}}else n.translate={x:parseInt(s("translate")[1]),y:0};if(e.includes("scale")&&a.includes("scale")&&s("scale"))if(s("scale")[1].includes(",")){let t=s("scale")[1].split(",").map(t=>parseFloat(t));n.scale={x:t[0],y:t[1]}}else n.scale={x:parseFloat(s("scale")[1]),y:parseFloat(s("scale")[1])};if(e.includes("rotate")&&a.includes("rotate")&&s("rotate")&&(n.rotate=parseFloat(s("rotate")[1])),e.includes("skew")&&a.includes("skew")&&s("skew"))if(s("skew")[1].includes(",")){let t=s("skew")[1].split(",").map(t=>parseFloat(t));n.skew={x:t[0],y:t[1]}}else n.skew={x:parseFloat(s("skew")[1]),y:0}}return s&&(n.translate={x:parseInt(o.left),y:parseInt(o.top)}),n},axSetStyleTransform=(t,e,s=!1)=>{let i=axIdToDom(t),o=i.style.transform,a=t=>new RegExp(`${t}\\(([^\\)]+)\\)`,"gmi");if(axIsEmpty(e))return!1;for(let t in e)if(e.hasOwnProperty(t)){let n="";"translate"===t?s?isNaN(e[t])?(i.style.left=`${e[t].x}px`,i.style.top=`${e[t].y}px`):i.style.left=`${e[t]}px`:(n=isNaN(e[t])?`${t}(${e[t].x}px,${e[t].y}px)`:`${t}(${e[t]}px)`,o.includes(t)?o.startsWith("translate")?o=o.replace(a(t),n):(o=o.replace(a(t),""),o=`${n} ${o}`):o=`${n} ${o}`):("scale"===t?n=isNaN(e[t])?`${t}(${e[t].x},${e[t].y})`:`${t}(${e[t]})`:"rotate"===t?n=`${t}(${e[t]}deg)`:"skew"===t&&(n=isNaN(e[t])?`${t}(${e[t].x}deg,${e[t].y}deg)`:`${t}(${e[t]}deg)`),o.includes(t)?o=o.replace(a(t),n):o+=` ${n}`)}return i.style.transform=o,o},axTplEngine=(t,e)=>{if(!t)return console.error("No html!"),!1;let s,i=/<#([^#>]+)?#>/g,o=/(^( )?(if|for|else|switch|case|break|{|}))(.*)?/g,a="let r=[];\n",n=0,r=(t,e)=>(a+=e?t.match(o)?t+"\n":"r.push("+t+");\n":""!=t?'r.push("'+t.replace(/"/g,'\\"')+'");\n':"",r);for(;s=i.exec(t);)r(t.slice(n,s.index))(s[1],!0),n=s.index+s[0].length;return r(t.substr(n,t.length-n)),a+='return r.join("");',new Function(a.replace(/[\r\t\n]/g,"")).apply(e)},axClone=t=>{let e=t=>{if(null===t)return null;if("object"!=typeof t)return t;if(t.constructor===Date)return new Date(t);{let e={};for(let s in t)if(null==t[s])e[s]=null;else if("object"!=typeof t[s]||t[s].nodeType)e[s]=t[s];else if(e[s]=axClone(t[s]),t[s]instanceof Array){let i=[];for(let e of t[s])i.push(axClone(e));e[s]=i}return e}};return Array.isArray(t)?t.map(t=>e(t)):e(t)},axMerge=(t,e,s={arrAppend:!1,clone:!1,attrAppend:!0})=>{if("object"!=typeof t||"object"!=typeof e)return e;if(!e)return t;let i=s.copy?axClone(t):t;for(let t in e)e.hasOwnProperty(t)&&i.hasOwnProperty(t)?i[t]?"Array"!=axType(e[t])?i[t]=axMerge(i[t],e[t],s):s.arrAppend?i[t].push(...e[t]):i[t]=e[t]:i[t]=e[t]:e.hasOwnProperty(t)&&!i.hasOwnProperty(t)&&s.attrAppend&&(i[t]=e[t]);return i},axStrToArr=(t,e,s)=>{let i=[],o={};return axIsEmpty(e)||e.forEach((t,e)=>{o[t]=axIsEmpty(s)?"":s[e]}),"["==t.substr(0,1)&&"]"==t.substr(-1)?i=JSON.parse(t):-1!=t.replace(/\s*/g,"").indexOf("},{")?i=JSON.parse("["+t+"]"):"{"==t.replace(/\s*/g,"").substr(0,1)&&"}"==t.replace(/\s*/g,"").substr(-1)?i=JSON.parse("["+t+"]"):(i=t.split(","),i.forEach((t,s)=>{if(t=t.trim(),"string"==typeof t&&!axIsEmpty(e)){let o={};e.forEach((e,s)=>{o[e]=0==s?t:""}),i.splice(s,1,o)}})),i.forEach(t=>{if(!axIsEmpty(o))for(let e in o)t.hasOwnProperty(e)?t.hasOwnProperty(e)&&!t[e]&&(t[e]=o[e]):t[e]=o[e]?o[e]:""}),i},axTplToArr=(t,e,s,i,o)=>{let a=axIdToDom(t),n=[];if(i){let t=a.querySelectorAll(i);t.forEach(t=>{let i={};e.forEach((e,a)=>{let n=t.querySelector("["+e+"]");i[s[a]]=n?n.getAttribute(e)?n.getAttribute(e).trim():n.innerHTML.trim():o[a]||""}),n.push(i)})}else{let t={};e.forEach((e,i)=>{let n=a.querySelector("["+e+"]");t[s[i]]=n?n.getAttribute(e)?n.getAttribute(e).trim():n.innerHTML.trim():o[i]||""}),n.push(t)}return n},axDataset=(t,e)=>{let s=t?axIdToDom(t):null,i=/^\d+(\.\d+)?$/,o=/^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/;if(s){let t=[...s.attributes].filter(t=>0==t.name.indexOf("data-"));if(!axIsEmpty(t)){let s=axClone(e),a=t=>{for(let e in t){let s=e.toLowerCase();t[s]=t[e],"Object"===axType(t[e])&&a(t[e]),s!=e&&delete t[e]}};a(s);for(let e=0;e{for(let s in t){let i=s.toLowerCase();"Object"===axType(t[s])?n(t[s],e[i]):t[s]=e[i]}};n(e,s)}}return e},axAttrToJson=(t,e)=>{let s=axIdToDom(t);if(!s)return console.warn("The attribute node does not exist!"),{};let i=s.getAttribute(e);if(!e||!i)return{};if(!i.includes(":"))return{};let o=i.trim();return o.startsWith("{")||(o="{"+o+"}"),new Function("return "+o)()},axExtend=(t,e,s,i)=>{if(!t)return console.error(axError.notExist),!1;let o=s?axIdToDom(s):null;return axMerge(t,e),o&&axMerge(t,axAttrToJson(o,i)),t},axAddPlan=(t,e,s)=>{let i=axType(t),o=[],a=t=>{s.handlers.hasOwnProperty(t)||(s.handlers[t]=[]);let i=e.toString().replace(/\s/g,"").replace(/\;/g,"").match(/{(\S*)}/)[1],o=s.handlers[t].toString().replace(/\s/g,"").replace(/\;/g,"");!(o.indexOf(i)>-1)&&s.handlers[t].push(e)};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axExePlan=(t,e,...s)=>{let i=axType(t),o=[],a=t=>{if(!e.handlers.hasOwnProperty(t))return console.warn(`The ${t} event is unregistered or unusable!`);e.handlers[t].forEach(t=>{t.call(e,...s)})};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axDelPlan=(t,e,s)=>{let i=axType(t),o=[],a=t=>{if(!s.handlers.hasOwnProperty(t))return console.warn(`The ${t} event is invalid or unusable!`);if(e){let i=s.handlers[t].findIndex(t=>t===e);if(void 0===i)return console.warn(`The ${t} event is not bound!`);s.handlers[t].splice(i,1),0===s.handlers[t].length&&delete s.handlers[t]}else delete s.handlers[t]};if("String"===i?o=t.includes(",")?t.split(","):t.split(" "):"Array"===i&&(o=t),o.length>0)for(let t of o)a(t)},axAddElem=(t,e,s)=>{let i=t.toLowerCase().trim(),o=document.createElement(i),a=function(t,e){if(""===e||null==e)return!1;"template"===i?t.innerHTML=e:Array.isArray(e)?e.length>0&&e.forEach(e=>{a(t,e)}):"object"==typeof e?t.appendChild(e):t.insertAdjacentHTML("beforeEnd",e)};if(e)for(let t in e)e.hasOwnProperty(t)&&o.setAttribute(t,e[t]);return a(o,s),o},axStrToFilter=(t,e,s)=>{let i=`source.filter(item =>${t})`,o=new Function("source","return "+i)(e);return s&&s(o),o},axRangeReplace=(t,e,s,i,o)=>{"string"!=typeof t&&(t=JSON.stringify(t)),"string"!=typeof e&&(t=JSON.stringify(e));let a="";return a=s||i?i?s?t.substring(0,s)+e+t.substring(i):o?t.substring(i-o)+e+t.substring(0,s):e+t.substring(i):o?t.substring(0,s)+e+t.substring(s+o):t.substring(0,s)+e:e,a},axArrange=(t,e,s=0,i=[],o=[])=>{let a=t.length;if(!(s+e>a)){for(let n=s;n{if(!t)return console.error("There is no options!"),!1;let i=axAddElem("SPAN",{"ajax-message":""}),o=e?axIdToDom(e):null;o&&o.appendChild(i);let a={url:"",selector:"",type:"post",async:!0,data:{},delay:6e6,contentType:"",headers:{},responseType:"",catchable:!1,abort:()=>{o?(i.innerHTML='中止了请求!',o.setAttribute("ajax-result","abort")):console.error("中止了请求!")},timeout:()=>{o?(i.innerHTML='请求超时了!',o.setAttribute("ajax-result","timeout")):console.error("请求超时了!")},loading:'',opened:"",before:t=>{o&&(i.innerHTML=t.content,o.setAttribute("ajax-result","before"))},downloading:()=>{},uploading:()=>{},success:t=>{o&&(o.innerHTML=t.content,o.setAttribute("ajax-result","success"))},error:t=>{o?(i.innerHTML=`错误状态:${t.status}`,o.setAttribute("ajax-result","error")):console.error(`错误状态:${t.status}`)}};for(let e in t)a[e]=t[e];let n="";n=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");let r="";if(!axIsEmpty(a.data))if("FormData"==axType(a.data))r=a.data;else if("Object"==axType(a.data))if(a.contentType.includes("json"))r=JSON.stringify(a.data);else{for(let t in a.data)r+="&"+t+"="+a.data[t];a.contentType="application/x-www-form-urlencoded"}else a.data=a.data.trim(),r=a.data.startsWith("&")?a.data.slice(1):a.data,a.contentType="application/x-www-form-urlencoded";if(a.headers["Content-Type"]=a.contentType,!a.contentType.includes("urlencoded")&&"get"==a.type.toLowerCase())return console.error("Please request data with post!"),!1;let l,h=()=>{for(let t in a.headers)a.headers[t]&&n.setRequestHeader(t,a.headers[t])};n.timeout=a.delay,n.responseType=a.responseType;let d=()=>{l&&n.removeEventListener("timeout",l),n.abort(),!axIsEmpty(a.abort)&&a.abort(o,n)},p=new Promise((t,e)=>{let i=(t,e)=>{let s=t.loaded,i=t.total,a=0,n=0,r="0%",l=new Date(t.timeStamp).getTime();t.lengthComputable&&(a=s/i,n=Math.round(100*a),r=n+"%",e&&e({result:r,percent:n,current:s,total:i,ratio:a,time:l,dom:o}))};n.upload.onprogress=(t=>{i(t,t=>{!axIsEmpty(a.uploading)&&a.uploading(t)})}),n.onprogress=(t=>{i(t,t=>{!axIsEmpty(a.downloading)&&a.downloading(t)})}),n.onerror=(t=>{let s={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.error)&&a.error(s),a.catchable&&e(s)}),l=(()=>{let t={content:n.response,status:n.status,dom:o,xhr:n};o&&o.setAttribute("ajax-result","timeout"),!axIsEmpty(a.timeout)&&a.timeout(t),a.catchable&&e(t)}),n.addEventListener("timeout",l),n.onreadystatechange=function(){if(n.readyState<4){let t={content:a.loading,status:n.status,dom:o,xhr:n,abort:d};1===n.readyState&&!axIsEmpty(a.opened)&&a.opened(t),!axIsEmpty(a.before)&&a.before(t),s&&s(t)}else if(n.status>=200&&n.status<300||304==n.status)if(a.responseType&&"text"!=n.responseType){o&&o.setAttribute("ajax-result","success");let e={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.success)&&a.success(e),t(e)}else{let e=document.createElement("div"),s="",i=/()<[^<]*)*<\/head>)|(<\/?html.*?>)|(<\!DOCTYPE.*?html.*?>)|(<\/?body.*?>)/gi,r=axStrEnd(a.url,"#"),l=a.selector||r;e.innerHTML=n.responseText,l&&e.querySelector(l)?s=e.querySelector(l).innerHTML:l&&!e.querySelector(l)?(console.warn(`The node of "${l}" is not exist!`),s=n.responseText.replace(i,"").trim()):s="{"==n.responseText.trim().substr(0,1)||"["==n.responseText.trim().substr(0,1)?JSON.parse(n.responseText.trim()):n.responseText.replace(i,"").trim(),o&&o.setAttribute("ajax-result","success");let h={content:s,status:n.status,dom:o,xhr:n};!axIsEmpty(a.success)&&a.success(h),t(h)}else{let t={content:n.response,status:n.status,dom:o,xhr:n};!axIsEmpty(a.error)&&a.error(t),a.catchable&&e(t)}},"get"==a.type.toLowerCase()?(n.open("get",a.url+"?now="+(new Date).getTime()+"&"+r,a.async),h(),n.send()):"post"==a.type.toLowerCase()&&(n.open("post",a.url,a.async),h(),n.send(r))});return p.xhr=n,p.abort=d,p},axAjaxSubmit=(t,e,s,i={type:type,success:success,loading:loading,delay:delay,before:before,error:error,opended:opended,other:other})=>{if(!t)return console.error("Url is required!"),!1;if(!e)return console.error("Form node is required!"),!1;i.type=i.type||"post",i.other=i.other||{};let o=axIdToDom(e),a=s?axIdToDom(s):null,n=a?a.innerHTML:"",r=i.loading||"button",l=Object.assign(i.other,{formClass:"ax-form-submitting",buttonClass:"ax-button-submitting",buttonText:"正在提交",overlayClass:"ax-form-overlay",overlayShowClass:"ax-show",successText:"恭喜!提交成功!",errorText:"对不起,提交失败!"}),h=o.querySelector(".ax-form-overlay")?o.querySelector(".ax-form-overlay"):axAddElem("div",{class:"ax-form-overlay"});if(o.classList.contains(l.formClass))return!1;if(a&&a.classList.contains(l.buttonClass))return!1;let d,p={};return o.querySelectorAll("[name]").forEach(function(t){p[t.getAttribute("name")]=t.value.trim()}),d=axAjax({url:t,data:p,type:i.type,opened:t=>{i.opened&&i.opened(t)},before:t=>{o.classList.add(l.formClass), a&&a.classList.add(l.buttonClass),"button"==r&&a?(a.innerHTML=l.buttonText,a.insertAdjacentHTML("afterbegin",'')):(h.innerHTML=t.content,h.classList.add(l.overlayClass),o.querySelector(".ax-form-overlay")||o.appendChild(h)),i.before&&i.before(t)},success:t=>{setTimeout(()=>{o.classList.remove(l.formClass),a&&a.classList.remove(l.buttonClass),"button"==r&&a?a.innerHTML=n:h.classList.remove(l.overlayClass),new axMessage({content:l.successText,result:"success",iconShow:!0}),i.success&&i.success(t)},0===i.delay?0:i.delay||1e3)},error:t=>{"button"==r&&a?a.innerHTML=n:h.classList.remove(l.overlayClass),new axMessage({content:l.errorText,result:"error",iconShow:!0}),i.error&&i.error(t)}}),d},axOffset=t=>{if(!t)return console.error(axError.notExist),!1;let e,s,i=document.documentElement.scrollLeft||window.pageXOffset||document.body.scrollLeft,o=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,a=axIdToDom(t);return e=a.getBoundingClientRect().left+i,s=a.getBoundingClientRect().top+o,{left:e,top:s}},axWidth=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t),{width:i,paddingLeft:o,paddingRight:a,marginLeft:n,marginRight:r,borderLeftWidth:l,borderRightWidth:h}=getComputedStyle(s);return i=parseInt(i,10),o=parseInt(o,10),a=parseInt(a,10),n=parseInt(n,10),r=parseInt(r,10),l=parseInt(l,10),h=parseInt(h,10),"inner"==e?i+o+a:"outer"==e?i+o+a+n+r+l+h:i},axHeight=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t),{height:i,paddingTop:o,paddingBottom:a,marginTop:n,marginBottom:r,borderTopWidth:l,borderBottomWidth:h}=getComputedStyle(s);return i=parseInt(i,10),o=parseInt(o,10),a=parseInt(a,10),n=parseInt(n,10),r=parseInt(r,10),l=parseInt(l,10),h=parseInt(h,10),"inner"==e?i+o+a:"outer"==e?i+o+a+n+r+l+h:i},axArrHeight=t=>{if(!t)return console.error(axError.notExist),!1;let e=axIdToDom(t),{height:s,paddingTop:i,paddingBottom:o,marginTop:a,marginBottom:n,borderTopWidth:r,borderBottomWidth:l}=getComputedStyle(e);return s=parseInt(s,10),i=parseInt(i,10),o=parseInt(o,10),a=parseInt(a,10),n=parseInt(n,10),r=parseInt(r,10),l=parseInt(l,10),{height:s,paddingTop:i,paddingBottom:o,marginTop:a,marginBottom:n,borderTopWidth:r,borderBottomWidth:l}},axSelector=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t),i=!0;if(e){e=String(e).replace(/\s+/g,""),e=String(e).split(",");for(let t=0;t{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t),i=!0;if(e){e=String(e).replace(/\s+/g,""),e=String(e).split(",");for(let t=0;t{if(!t)return console.error(axError.notExist),!1;let o=axIdToDom(t);return[...o.parentNode.children].filter(t=>e?axSelector(t,s)&&!axNot(t,i):t!==o&&axSelector(t,s)&&!axNot(t,i))},axChildren=(t,e,s)=>{if(!t)return console.error(axError.notExist),!1;let i=axIdToDom(t);return[...i.children].filter(t=>axSelector(t,e)&&!axNot(t,s))},axParents=(t,e,s,i,o=[])=>{if(!t)return console.error("No node to start!"),!1;let a=axIdToDom(t),n=e?axIdToDom(e):null;return"BODY"!==a.parentElement.nodeName?(s&&o.indexOf(a)<0&&o.push(a),n?(i&&o.indexOf(n)<0&&o.push(n),a.parentElement!==n?(o.push(a.parentElement),axParents(a.parentElement,n,s,i,o)):o):(o.push(a.parentElement),axParents(a.parentElement,n,s,i,o))):o},axCurves={linear:t=>t,easeIn:t=>t*t*t,easeOut:t=>(t-1)*(t-1)*(t-1)+1,easeInOut:t=>t<.5?2*t*t:-2(t-1)*(t-1)+1,easeOutIn:t=>t<.5?Math.sqrt(.5*t):1-Math.sqrt(.5*(1-t))},axSlideDown=(t,e,s,i,o="easeOut")=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t),n=t=>t/3+250,r=a.style.cssText;if(e=e||"block","none"===window.getComputedStyle(a).display){a.style.cssText=`${r}display: ${e};`;const{height:t,paddingTop:l,paddingBottom:h,marginTop:d,marginBottom:p}=axArrHeight(a);let c;c=void 0!==i&&"number"==typeof i?i:n(t),a.style.cssText=`${r}display: ${e}; padding-top: 0; padding-bottom: 0;margin-top: 0; margin-bottom: 0;`;const u=(new Date).getTime(),m=()=>{const i=(new Date).getTime()-u,n=i/c,g=axCurves[o](n),f=0+t*g,x=0+l*g,y=0+h*g,b=0+d*g,v=0+p*g;i<=c&&Math.ceil(f)=t||!t)&&(cancelAnimationFrame(D),s&&s())};m()}return a},axHeightDown=(t,e,s,i,o="easeOut")=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t),n=t=>t/3+250;const r=e&&e.height?e.height:axArrHeight(a).height,l=e&&e.paddingTop?e.paddingTop:axArrHeight(a).paddingTop,h=e&&e.paddingBottom?e.paddingBottom:axArrHeight(a).paddingBottom,d=e&&e.marginTop?e.marginTop:axArrHeight(a).marginTop,p=e&&e.marginBottom?e.marginBottom:axArrHeight(a).marginBottom;let c;c=void 0!==i&&"number"==typeof i?i:n(r),a.style.overflow="hidden",a.style.height=0,l&&(a.style.paddingTop=0),h&&(a.style.paddingBottom=0),d&&(a.style.marginTop=0),p&&(a.style.marginBottom=0);const u=(new Date).getTime(),m=()=>{const t=(new Date).getTime()-u,e=t/c,i=axCurves[o](e),n=0+r*i,g=0+l*i,f=0+h*i,x=0+d*i,y=0+p*i;t<=c&&Math.ceil(n)=r||!r)&&(cancelAnimationFrame(b),s&&s())};return m(),a},axSlideUp=(t,e,s,i,o="easeOut")=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t),n=t=>t/3+250,r=a.style.cssText;if(e=e||"block","none"!==window.getComputedStyle(a).display){const{height:t,paddingTop:l,paddingBottom:h,marginTop:d,marginBottom:p}=axArrHeight(a);let c;c=void 0!==i&&"number"==typeof i?i:n(t),a.style.cssText=`${r}display: ${e}; padding-top: 0; padding-bottom: 0;margin-top: 0; margin-bottom: 0;`;const u=(new Date).getTime(),m=()=>{const i=(new Date).getTime()-u,n=i/c,g=axCurves[o](n),f=t+-t*g,x=l+-l*g,y=h+-h*g,b=d+-d*g,v=p+-p*g;i<=c&&Math.floor(f)>0?a.style.cssText=`${r}overflow:hidden;display: ${e}; padding-top: ${x}px; padding-bottom: ${y}px;margin-top: ${b}px; margin-bottom: ${v}px; height: ${f}px`:a.style.cssText=`${r}display: none`;const D=requestAnimationFrame(m);(Math.floor(f)<=0||!t)&&(cancelAnimationFrame(D),s&&s())};m()}return a},axHeightUp=(t,e,s,i,o="easeOut")=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t),n=t=>t/3+250;const r=e&&e.height?e.height:axArrHeight(a).height,l=e&&e.paddingTop?e.paddingTop:axArrHeight(a).paddingTop,h=e&&e.paddingBottom?e.paddingBottom:axArrHeight(a).paddingBottom,d=e&&e.marginTop?e.marginTop:axArrHeight(a).marginTop,p=e&&e.marginBottom?e.marginBottom:axArrHeight(a).marginBottom;let c;c=void 0!==i&&"number"==typeof i?i:n(r),a.style.overflow="hidden";const u=(new Date).getTime(),m=()=>{const t=(new Date).getTime()-u,e=t/c,i=axCurves[o](e),n=r+-r*i,g=l+-l*i,f=h+-h*i,x=d+-d*i,y=p+-p*i;t<=c&&Math.floor(n)>0?(a.style.height=n+"px",l&&(a.style.paddingTop=g+"px"),h&&(a.style.paddingBottom=f+"px"),d&&(a.style.marginTop=x+"px"),p&&(a.style.marginBottom=y+"px")):(a.style.height=0,l&&(a.style.paddingTop=0),h&&(a.style.paddingBottom=0),d&&(a.style.marginTop=0),p&&(a.style.marginBottom=0));const b=requestAnimationFrame(m);(Math.floor(n)<=0||!r)&&(cancelAnimationFrame(b),s&&s())};return m(),a},axSlideToggle=(t,e,s,i,o,a="easeOut")=>{if(!t)return console.error(axError.notExist),!1;let n=axIdToDom(t);return e=e||"block","none"===window.getComputedStyle(n).display?axSlideDown(n,e,s,o,a):axSlideUp(n,e,i,o,a),n},axFadeIn=(t,e,s,i=200,o="linear")=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t);if(e=e||"block",a){let t=window.getComputedStyle(a).display,s=window.getComputedStyle(a).opacity;if("none"===t){a.style.display=e,a.style.opacity=0;let t=(new Date).getTime(),s=()=>{let e=(new Date).getTime()-t,n=e/i,r=axCurves[o](n);a.style.opacity=e<=i&&r<=1?r:1;let l=requestAnimationFrame(s);r>=1&&cancelAnimationFrame(l)};s()}else if("none"!==t&&1!==Number(s)){let t=(new Date).getTime(),e=()=>{let n=(new Date).getTime()-t,r=n/i,l=axCurves[o](r)+Number(s);a.style.opacity=n<=i&&l<=1?l:1;let h=requestAnimationFrame(e);l>=1&&cancelAnimationFrame(h)};e()}}return s&&s(),a},axFadeOut=(t,e,s=200,i="linear")=>{if(!t)return console.error(axError.notExist),!1;let o=axIdToDom(t);if(o){let t=window.getComputedStyle(o).display,e=window.getComputedStyle(o).opacity;if("none"!==t||0!==Number(e)){o.style.opacity=e;let t=(new Date).getTime(),a=()=>{let n=(new Date).getTime()-t,r=n/s,l=Number(e)-axCurves[i](r);n<=s&&l>0?o.style.opacity=l:(o.style.opacity=0,o.style.display="none");let h=requestAnimationFrame(a);l<=0&&cancelAnimationFrame(h)};a()}}return e&&e(),o},axFadeToggle=(t,e,s,i,o=200,a="linear")=>{if(!t)return console.error(axError.notExist),!1;let n=axIdToDom(t);if(n){let t=window.getComputedStyle(n).display,r=window.getComputedStyle(n).opacity;"none"===t?axFadeIn(n,e,s,o,a):Number(r)<=.5?axFadeIn(n,e,s,o,a):(Number(r),axFadeOut(n,i,o,a))}return n},axShow=(t,e,s)=>{if(!t)return console.error(axError.notExist),!1;let i=axIdToDom(t);"visible"==e?i.style.visibility="visible":i.style.display=e||"block",s&&s()},axHide=(t,e,s)=>{if(!t)return console.error(axError.notExist),!1;let i=axIdToDom(t);"hidden"==e?i.style.visibility="hidden":i.style.display="none",s&&s()},axToggle=(t,e,s,i,o)=>{if(!t)return console.error(axError.notExist),!1;let a=axIdToDom(t);axIsVisible(a)?axHide(a,s,o):axShow(a,e,i)},axScrollTo=(t,e={})=>{let s,i=e.parent?axIdToDom(e.parent):null,o=i||window,a=~~e.offset||0,n=e.curve||"easeOut",r="number"==typeof t?"":axIdToDom(t),l=document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop,h=i?i.scrollTop:l,d=(new Date).getTime();i&&"static"===axStyle(i).position&&(i.style.position="relative"),s=r?i?r.offsetTop-i.scrollTop:r.getBoundingClientRect().top:"number"==typeof t?t-h:-h;let p=e.duration&&"number"==typeof e.duration?e.duration:Math.abs(s)/4+1e3,c=()=>{let t=(new Date).getTime()-d,e=t/p,i=h+(s-a)*axCurves[n](e);o.scrollTo(0,i),c.timer=requestAnimationFrame(c),t>=p&&(o.scrollTo(0,i),cancelAnimationFrame(c.timer))};return c(),t},axIcon={font:{success:'',error:'',warning:'',info:'',question:'',successFill:'',errorFill:'',warningFill:'',infoFill:'',questionFill:''},svg:{success:'',error:'',warning:'',info:'',question:''}},axImage={load:getComputedStyle(document.documentElement).getPropertyValue("--load").trim().split('"')[1],loadW:getComputedStyle(document.documentElement).getPropertyValue("--load-w").trim().split('"')[1],blank:getComputedStyle(document.documentElement).getPropertyValue("--blank").trim().split('"')[1],avatar:getComputedStyle(document.documentElement).getPropertyValue("--avatar").trim().split('"')[1],empty:getComputedStyle(document.documentElement).getPropertyValue("--empty").trim().split('"')[1],none:getComputedStyle(document.documentElement).getPropertyValue("--none").trim().split('"')[1]},axGetColors=()=>{let t=getComputedStyle(document.documentElement),e=e=>[t.getPropertyValue(`--h-${e}`),t.getPropertyValue(`--s-${e}`),t.getPropertyValue(`--l-${e}`),t.getPropertyValue(`--a-${e}`)].map(t=>{let e=t.trim();return e.includes("%")?e:Number(e)});return{primary:e("primary"),text:e("text"),success:e("success"),error:e("error"),info:e("info"),warning:e("warning"),question:e("question")}},axResult=(t,e)=>{if(!t)return console.error(axError.notExist),!1;let s=axIdToDom(t),i="";switch(e){case"success":i='\n ',s.querySelector("svg").classList.add("svg-success");break;case"error":i='\n \n ',s.querySelector("svg").classList.add("svg-error");break;case"question":i='\n \n ',s.querySelector("svg").classList.add("svg-question");break;case"info":i='\n \n ',s.querySelector("svg").classList.add("svg-info")}s.classList.add("ax-result-show"),-1==s.querySelector("svg").innerHTML.indexOf("svg-in-1")&&s.querySelector("svg").insertAdjacentHTML("beforeend",i)},axCreateContent=(t,e,s)=>{let i,o=t.content,a={};if(t.url)if("async"===t.type){let n="",r="";"id"==axStrType(t.url)?(n=t.url.match(/(\S*)\#/)[1],r="#"+t.url.match(/\#(\S*)/)[1]):n=t.url,a=axAjax({url:n,selector:r,type:t.ajaxType||"post",opened:t=>{e.contentXhr=t.xhr},before:t=>{i=t.content},success:t=>{i="function"==typeof o?o(t.content):t.content,s&&s.call(e,i)}})}else"iframe"===t.type?(i=``,t.footerShow=!1):"picture"===t.type?i=`\n
\n
${t.name}
\n ${o}\n `:"video"===t.type?i=`\n
\n
${t.name}
\n ${o}\n `:"audio"===t.type&&(i=`\n
\n
${t.name}
\n ${o}\n `),s&&s.call(e,i);else i="html"==t.type?"string"==typeof o&&"id"==axStrType(o)?document.querySelector(o).innerHTML:"function"==typeof o?o.call(e):o:o||"没有任何内容!",s&&s.call(e,i);return a.content=i,s&&s(i),a},axBreakpoints=(t,e)=>{if(axIsEmpty(t))return!1;let s=[],i={},o=document.body.clientWidth,a=(t,e)=>{t.startsWith("ceil")?axCeil[t.split("-")[1]]>o&&s.push(e):t.startsWith("client")?t.split("-")[1]===axClient()&&s.push(e):t.startsWith("width")?t.split("-")[1]>o&&s.push(e):t.startsWith("mobile")?t.split("-")[1]==axIsMobi()&&s.push(e):t>o&&s.push(e)};for(let t in e)e.hasOwnProperty(t)&&(Reflect.deleteProperty(e[t],"breakpoint"),a(t,e[t]));if(0===s.length)return!1;i=Object.assign(...s),axExtend(t,i)},axFooterBtns=t=>{let e=t.footerBreak?'
':"",s="";if(t.note&&(t.note=`
${t.note}
`),t.footerShow)if("right"==t.footerType){let i="",o="",a="";t.confirm.text&&(o=`${t.confirm.icon}${t.confirm.text}`),t.cancel.text&&(i=`${t.cancel.icon}${t.cancel.text}`),t.diy.text&&t.diy.callback?a=`${t.diy.icon}${t.diy.text}`:t.diy.text&&!t.diy.callback&&(a=`${t.diy.icon}${t.diy.text}`),s=`\n ${e}\n
\n
\n
\n ${t.note}\n
\n
${a}${i}${o}
\n
\n
\n `}else if("line"==t.footerType){let e="",i="",o="";t.confirm.text&&(i=`${t.confirm.icon}${t.confirm.text}`),t.cancel.text&&(e=`${t.cancel.icon}${t.cancel.text}`),t.diy.text&&t.diy.callback?o=`${t.diy.icon}${t.diy.text}`:t.diy.text&&!t.diy.callback&&(o=`${t.diy.icon}${t.diy.text}`),s=`\n
\n
${o}${e}${i}
${t.note}\n `}else{let i="",o="",a="";t.confirm.text&&(o=`${t.confirm.icon}${t.confirm.text}`),t.cancel.text&&(i=`${t.cancel.icon}${t.cancel.text}`),t.diy.text&&t.diy.callback?a=`${t.diy.icon}${t.diy.text}`:t.diy.text&&!t.diy.callback&&(a=`${t.diy.icon}${t.diy.text}`),s=`\n ${e}\n
${a}${i}${o}
\n
${t.note}\n `}else s="";return s},axLocalTime=(t,e)=>{let s,i,o,a,n;if(t){if(t=t.trim(),i=new Date(t),o=i instanceof Date&&!isNaN(i.getTime()),!o)return console.error('Date format must be "YYYY-MM-DD" or "YYYY/MM/DD"');s=t.replace(/-/g,"/"),a=new Date(s).getTime(),n=-1!==s.indexOf(":")?0:6e4*new Date(s).getTimezoneOffset()}else a=(new Date).getTime(),n=0;return e?a-n:a},axCreateData=(t,e=["src","cover","caption","type"],s=["media","cover","caption","type"],i="figure",o=["","","","image"],a)=>{let n=[],r="";return"String"===axType(t)&&"id"==axStrType(t)?n=axTplToArr(t,e,s,i,o):("Array"===axType(t)||"Object"===axType(t)?r=JSON.stringify(t):"String"===axType(t)&&(r=t),n=axStrToArr(r,s,o)),n=n.filter(t=>t[s[0]]),a&&a(n),n},axSort=(t,e,s)=>{let i=[];Array.isArray(e)?i=e.filter(t=>t.order):e.order&&i.push(e);let o=(t,e,i)=>{if(0==i.length)return 0;let a,n,r,l=i.shift(),h=l.col,d=l.order,p=l.attr||"label";return"table"==s?"number"==typeof h?(n=t.children.filter(t=>t.index===h)[0][p],r=e.children.filter(t=>t.index===h)[0][p]):(n=t.children.find(t=>t.name===h)[p],r=e.children.find(t=>t.name===h)[p]):(n=t[h],r=e[h]),a=isNaN(n-r)?"desc"===d?r.localeCompare(n,"zh-CN-u-kf-lower"):n.localeCompare(r,"zh-CN-u-kf-lower"):"desc"===d?r-n:n-r,n===r?o(t,e,i):a};return t.sort((t,e)=>o(t,e,[...i]))},axSerialize=(t,e="string",s=",")=>{let i,o,a=[];if(i=Array.isArray(t)?t:[...axIdToDom(t).querySelectorAll("[name]")].filter(t=>["INPUT","SELECT","TEXTAREA"].includes(t.nodeName)&&t.name&&!t.name.includes("_ax_alt")),i.forEach(t=>{let e=a.find(e=>e.name==t.name);e?"checkbox"!=t.type&&"radio"!=t.type||e.dom.push(t):a.push({name:t.name,type:t.type,dom:[t]})}),a.forEach(t=>{"file"==t.type?t.value=axMultiValues(t.dom[0],"file","array"):"checkbox"==t.type?t.value=axMultiValues(t.dom,"checkbox","string","",s):"radio"==t.type?t.value=axMultiValues(t.dom,"radio","string"):t.type.includes("select")?t.value=axMultiValues(t.dom[0],"select","string","",s):t.value=t.dom[0].value}),"string"==e){let t="";a.forEach(e=>{t+="&"+e.name+"="+e.value}),o=t}else if("json"==e){let t={};a.forEach(e=>{t[e.name]=e.value}),o=t}else"array"==e&&(a.forEach(t=>{delete t.type,delete t.dom}),o=a);return o},axArrSearch=(t,e,s,i)=>{if(axIsEmpty(t)||axIsEmpty(e)||!s||0===s.length)return[];let o=Object.assign({fuzzy:!0,separator:" ",limit:0,reorder:!1,ignore:!0},i),a=axSplitToArr(t,o.separator),n=axSplitToArr(e,","),r=[],l="("+a.join("|")+")",h=new RegExp(l,`${o.ignore?"i":""}g`);for(let t of s){let e=n.map(e=>t[e]).join("■"),s=e.match(h),i={};s&&(i={source:t,weight:s.length,keys:[...new Set(s)]},o.fuzzy?r.push(i):[...new Set(s)].length===a.length&&r.push(i))}return o.reorder&&r.sort((t,e)=>e.weight-t.weight),o.limit&&r.length>o.limit&&r.splice(o.limit),r};class axObserve{constructor(t,e){if(this.dataType=axType(t),"Object"!==this.dataType&&"Array"!==this.dataType)return{instance:this,proxy:t};if(this.options=axExtend({deep:!1,accept:!0,once:!1,methods:["set","deleteProperty"],callback:""},e),this.handlers={},this.completeIndex=0,this.reacts=0,this.proxys=[],this.data=t,this.fullMethods={get:(t,e,s)=>{let i=t[e];return this.options.callback&&this.options.callback({target:t,key:e,proxy:s,value:i,type:"get"}),this.handlers.hasOwnProperty(e)&&this.emit(e,{target:t,key:e,proxy:s,value:i,type:"get"}),Reflect.get(t,e,s)},set:(t,e,s,i)=>{if(JSON.stringify(t[e])==JSON.stringify(s))return!0;let o=axType(s),a=t[e],n=void 0===t[e]?"add":"edit";return"Object"!==o&&"Array"!==o||!this.options.deep||(s=this.proxy(s)),this.options.accept&&Reflect.set(t,e,s,i),this.options.callback&&this.options.callback({target:t,key:e,proxy:i,value:s,raw:a,type:n}),this.handlers.hasOwnProperty(e)&&this.emit(e,{target:t,key:e,proxy:i,value:s,raw:a,type:n}),this.reacts++,this.complete(this.reacts),!0},deleteProperty:(t,e)=>{let s=t[e];return this.options.accept&&Reflect.deleteProperty(t,e),this.options.callback&&this.options.callback({target:t,key:e,value:s,type:"delete"}),this.handlers.hasOwnProperty(e)&&this.emit(e,{target:t,key:e,value:s,type:"delete"}),this.reacts++,this.complete(this.reacts),!0}},this.methods={},this.options.methods.forEach(t=>{this.methods[t]=this.fullMethods[t]}),this.options.deep)for(let e in t)if(t.hasOwnProperty(e)){let s=axType(t[e]);"Object"!==s&&"Array"!==s||(t[e]=this.proxy(t[e]))}return{instance:this,proxy:this.proxy(t)}}complete(t){setTimeout(()=>{if(t===this.reacts){if(this.options.once&&0!==this.completeIndex)return!1;this.options.callback&&this.options.callback({target:this.data,proxy:this.proxys[0],type:"complete"}),this.handlers.hasOwnProperty("complete")&&this.emit("complete",{target:this.data,proxy:this.proxys[0],type:"complete"}),this.completeIndex++}},0)}proxy(t){let e=new Proxy(t,this.methods);return 0===this.proxys.length&&this.proxys.push(e),e}on(t,e){return axAddPlan(t,e,this),this}emit(t,...e){axExePlan(t,this,...e)}off(t,e){return axDelPlan(t,e,this),this}}class AXINSTANCE{constructor(){this.data=[],this.destroyFun=(t=>{if(!t)return!1;t.instance.hasOwnProperty("destroyed")&&t.instance.destroyed||!t.instance.__proto__.destroy||(t.instance.destroy(),t.log=`destroy(${(new Date).toLocaleString()})`)}),this.initFun=(t=>{if(!t)return!1;t.instance.hasOwnProperty("destroyed")&&!t.instance.destroyed||!t.instance.__proto__.init||(t.instance.init(),t.log=`init(${(new Date).toLocaleString()})`)})}push(t,e,s){if(!t)return!1;let i={name:e,instance:t,type:s||"",log:`push(${(new Date).toLocaleString()})`};this.data.some(e=>e.instance===t)||this.data.push(i)}find(t,e,s=!1){if(!t)return!1;let i;return i=e?this.data.find(i=>i.instance.hasOwnProperty("destroyed")?i.name===t&&i.type===e&&i.instance.destroyed===s:i.name===t&&i.type===e):this.data.find(e=>e.instance.hasOwnProperty("destroyed")?e.name===t&&e.instance.destroyed===s:e.name===t),i?i.instance:i}findAll(t,e=!1){let s=[];return s=t?this.data.filter(s=>s.instance.hasOwnProperty("destroyed")?s.type===t&&s.instance.destroyed===e:s.type===t):i.instance.hasOwnProperty("destroyed")?this.data.filter(t=>t.instance.destroyed===e):this.data,s.length>0?s.map(t=>t.instance):s}destroy(t,e,s){if(!t)return!1;let i;i=e?this.data.find(s=>s.name===t&&s.type===e):this.data.find(e=>e.name===t),this.destroyFun(i),s&&s(i)}destroyAll(t,e){if(!t)return this.data.forEach(t=>{this.destroyFun(t)}),e&&e(this.data),!1;{let s=this.data.filter(e=>e.type===t);s.forEach(t=>{this.destroyFun(t)}),e&&e(s)}}clear(t){this.data.forEach(t=>{this.destroyFun(t)}),this.data.length=0,t&&t()}init(t,e,s){if(!t)return!1;let i;i=e?this.data.find(s=>s.name===t&&s.type===e):this.data.find(e=>e.name===t),this.initFun(i),s&&s(i)}initAll(t,e){if(!t)return this.data.forEach(t=>{this.initFun(t)}),e&&e(this.data),!1;{let s=this.data.filter(e=>e.type===t);s.forEach(t=>{this.initFun(t)}),e&&e(s)}}}const axInstance=new AXINSTANCE;class axCage{constructor(t,e){if(!t)return!1;if(this.targetDom=axIdToDom(t),!this.targetDom||0===this.targetDom.children.length)return!1;this.options=axExtend({insName:"",init:!0,unbound:{attr:"unbound",selector:""},dampingRatio:.5,duration:300,drift:{enable:!1,timeTHR:200,distTHR:20,coef:2},scale:{enable:!1,min:1,max:5},completedTHR:20,breakpoints:{},onInit:"",onCompleted:"",onStart:"",onMove:"",onEnd:"",onScaled:"",onScaledMin:"",onScaledMax:"",onTranslated:"",onRefactored:"",onResized:"",onFitted:"",onSlided:"",onUpdated:"",onDestroy:""},e,this.targetDom,this.constructor.name);let s=this;this.handlers={},this.isMobi=axIsMobi(),this.events=this.isMobi?["touchstart","touchmove","touchend"]:["mousedown","mousemove","mouseup"],this.started=!1,this.scrollObj=axGetScrollObj(),this.startFun=function(t){if(t.stopPropagation(),s.unbounds.length>0&&s.unbounds.includes(t.target))return!1;t.preventDefault(),s.startValue={...s.getCoordValue(t)};let e=s.slides.find(t=>t.dom===this),i={...s.startValue};s.distStart={x:i.x-e.last.x,y:i.y-e.last.y},s.startTime=t.timeStamp,s.started=!0,this.setAttribute("active",""),e.active=!0,this.style.transitionDuration="0ms",s.handlers.hasOwnProperty("start")&&s.emit("start",e),s.options.onStart&&s.options.onStart.call(s,e)},this.moveFun=function(t){if(t.stopPropagation(),!s.isMobi&&!s.started)return!1;if(s.unbounds.length>0&&s.unbounds.includes(t.target))return!1;t.preventDefault();let e=s.getCoordValue(t);JSON.stringify(e)!=JSON.stringify(s.startValue)&&s.targetDom.setAttribute("moving","");let i=s.slides.find(t=>t.dom===this),o=t=>i.range[t][0]+(i.now[t]-i.range[t][0])*Math.pow(s.options.dampingRatio,2),a=t=>i.range[t][1]+(i.now[t]-i.range[t][1])*Math.pow(s.options.dampingRatio,2);i.now={x:e.x-s.distStart.x,y:e.y-s.distStart.y},i.now.y=s.options.completedTHR&&(s.handlers.hasOwnProperty("completed")&&s.emit("completed","top"),s.options.onCompleted&&s.options.onCompleted.call(s,"top"))):i.now.y>i.range.y[1]&&(i.now.y=a("y"),Math.abs(i.now.y-i.range.y[1])>=s.options.completedTHR&&(s.handlers.hasOwnProperty("completed")&&s.emit("completed","bottom"),s.options.onCompleted&&s.options.onCompleted.call(s,"bottom"))),i.now.x=s.options.completedTHR&&(s.handlers.hasOwnProperty("completed")&&s.emit("completed","left"),s.options.onCompleted&&s.options.onCompleted.call(s,"left"))):i.now.x>i.range.x[1]&&(i.now.x=a("x"),Math.abs(i.now.x-i.range.x[1])>=s.options.completedTHR&&(s.handlers.hasOwnProperty("completed")&&s.emit("completed","right"),s.options.onCompleted&&s.options.onCompleted.call(s,"right"))),s.setValues({item:i,value:i.now,apply:!1}),s.handlers.hasOwnProperty("move")&&s.emit("move",i),s.options.onMove&&s.options.onMove.call(s,i)},this.endFun=function(t){if(t.stopPropagation(),s.targetDom.removeAttribute("moving"),!s.isMobi&&!s.started)return!1;t.preventDefault(),s.started=!1;let e=s.slides.find(t=>t.active),i=s.computeHYP({...e.now},{...e.last}),o=i.HYP,a=i.SIN,n=i.COS;e.last={...e.now},e.dom.style.cssText=e.dom.style.cssText.replace("transition-duration: 0ms","");let r,l=t.timeStamp-s.startTime;if(s.options.drift.enable&&ls.options.drift.distTHR){let t=(s.options.drift.timeTHR-l)*s.options.drift.coef;r={x:~~(e.last.x+a*t),y:~~(e.last.y+n*t)}}else r=e.now;s.slideTo({item:e,value:r}),e.dom.removeAttribute("active"),Reflect.deleteProperty(e,"active"),s.handlers.hasOwnProperty("end")&&s.emit("end",e),s.options.onEnd&&s.options.onEnd.call(s,e)},this.scrollFun=axThrottle(function(t){if(t.stopPropagation(),t.preventDefault(),s.unbounds.length>0&&s.unbounds.includes(this))return!1;let e=s.slides.find(t=>t.dom===this),i=axIsScrollUp(t,s.scrollObj.detail);i?(e.scale++,e.scale>=s.options.scale.max&&(e.scale=s.options.scale.max)):(e.scale--,e.scale<=s.options.scale.min&&(e.scale=s.options.scale.min)),(e.scale<=s.options.scale.max||e.scale>=s.options.scale.min)&&(e.scale=axNumber(e.scale,{places:0,mode:"floor"}),this.style.transitionDuration=s.options.duration+"ms",s.setValues({type:"scale",item:e,value:e.scale}),setTimeout(()=>{s.updateItem(e)},s.options.duration))},s.options.duration,!0),this.slidedEvent=function(t){t.stopPropagation(),s.response(this)},this.mutationObs=new MutationObserver(t=>{t.forEach(t=>{if("attributes"===t.type&&t.target!==this.targetDom){let e=this.slides.find(e=>e.dom===t.target),s=this.getValues(e);s[0]==e.scale&&s[3]==e.scale||(this.handlers.hasOwnProperty("scaled")&&this.emit("scaled",e,s[0]),this.options.onScaled&&this.options.onScaled.call(this,e,s[0]),e.scale===this.options.scale.min?(e.boundary="min",this.handlers.hasOwnProperty("scaledMin")&&this.emit("scaledMin",e,this.options.scale.min),this.options.onScaledMin&&this.options.onScaledMin.call(this,e,this.options.scale.min)):e.scale===this.options.scale.max?(e.boundary="max",this.handlers.hasOwnProperty("scaledMax")&&this.emit("scaledMax",e,this.options.scale.max),this.options.onScaledMax&&this.options.onScaledMax.call(this,e,this.options.scale.max)):Reflect.deleteProperty(e,"boundary")),s[4]==e.now.x&&s[5]==e.now.y||(this.handlers.hasOwnProperty("translated")&&this.emit("translated",e,{x:s[4],y:s[5]}),this.options.onTranslated&&this.options.onTranslated.call(this,e,{x:s[4],y:s[5]}))}"childList"===t.type&&t.target===this.targetDom&&(this.options.unbound&&this.getUnbounds(),this.handlers.hasOwnProperty("refactored")&&this.emit("refactored",""),this.options.onRefactored&&this.options.onRefactored.call(this))})}),this.slideDomSizeObserver=new ResizeObserver(axDebounce(t=>{for(let e of t)this.response(e.target),this.handlers.hasOwnProperty("resized")&&this.emit("resized",e,e.target),this.options.onResized&&this.options.onResized.call(this,e,e.target)})),this.targetDomSizeObserver=new ResizeObserver(axDebounce(t=>{for(let e of t)this.response(),this.handlers.hasOwnProperty("resized")&&this.emit("resized",e,this.targetDom),this.options.onResized&&this.options.onResized.call(this,e,this.targetDom)})),this.options.init?this.init():this.destroyed=!0}init(t){return axInstance.push(this,this.options.insName,"cage"),!axIsEmpty(this.options.breakpoints)&&axBreakpoints(this.options,this.options.breakpoints),this.destroyed=!1,this.getUnbounds(),this.slides=[...this.targetDom.children].map(t=>({dom:t,last:{x:0,y:0},now:{x:0,y:0},difference:{x:0,y:0},size:{width:0,height:0},offset:{x:0,y:0},shape:"",range:{x:[],y:[]},scale:1})),this.setAttribute(),this.updateTarget(),this.distStart={x:0,y:0},this.addTargetEvent(),this.slides.forEach(t=>{this.addItemEvent(t.dom)}),this.handlers.hasOwnProperty("init")&&this.emit("init",""),this.options.onInit&&this.options.onInit.call(this),t&&t.call(this),this}computeHYP(t,e){let s={...t},i={...e},o=Math.abs(s.x-i.x),a=Math.abs(s.y-i.y),n=Math.sqrt(o*o+a*a),r=n?(s.x-i.x)/n:0,l=n?(s.y-i.y)/n:0;return{HYP:n,SIN:r,COS:l}}setAttribute(){!this.targetDom.classList.contains("ax-cage")&&this.targetDom.classList.add("ax-cage"),"hidden"!==axStyle(this.targetDom).overflow&&(this.targetDom.style.overflow="hidden"),"static"===axStyle(this.targetDom).position&&(this.targetDom.style.position="relative")}getUnbounds(){this.unbounds=this.getDomsFromArg(this.options.unbound.selector),this.unbounds.forEach(t=>t.setAttribute(this.options.unbound.attr,""))}getDomsFromArg(t){let e=[];if(t){let s=axType(t);"String"===s?e=[...this.targetDom.querySelectorAll(t)]:"Array"===s?e=t:s.includes("HTML")&&e.push(t)}return e}fitTo(t){if(this.destroyed)return this;let e=Object.assign({item:this.slides[0],placement:"left-top",duration:this.options.duration},t),s=axType(e.item),i=s.includes("HTML")?this.slides.find(t=>t.dom===e.item):"String"===s?this.targetDom.querySelector(e.item):e.item,o={},a=this.getScaleOffset(i);if(!i||this.unbounds.includes(i.dom))return!1;switch(e.placement){case"right-top":o={x:i.difference.x,y:0};break;case"left-bottom":o={x:0,y:i.difference.y};break;case"right-bottom":o={...i.difference};break;case"left":o={x:0,y:i.now.y};break;case"right":o={x:i.difference.x,y:i.now.y};break;case"top":o={x:i.now.x,y:0};break;case"bottom":o={x:i.now.x,y:i.difference.y};break;default:o={x:0,y:0}}(e.placement.includes("left")||e.placement.includes("right"))&&(o.x+=a.x),(e.placement.includes("top")||e.placement.includes("bottom"))&&(o.y+=a.y),i.dom.style.transitionDuration=e.duration+"ms",this.setValues({value:o,item:i}),setTimeout(()=>{this.handlers.hasOwnProperty("fitted")&&this.emit("fitted",i),this.options.onFitted&&this.options.onFitted.call(this,i),e.callback&&e.callback.call(this,i)},e.duration)}getEdgeValue(t,e){let s,i=axType(t);if(i.includes("HTML")||"String"===i){let e=axIdToDom(t);!e||(s={x:-e.offsetLeft,y:-e.offsetTop})}else s={...t};return!axIsEmpty(s)&&s.hasOwnProperty("x")&&s.hasOwnProperty("y")&&(s.xe.range.x[1]&&(s.x=e.range.x[1]),s.ye.range.y[1]&&(s.y=e.range.y[1])),s}slideTo(t){if(this.destroyed)return this;let e=Object.assign({item:this.slides[0]},t),s=axType(e.item),i=s.includes("HTML")?this.slides.find(t=>t.dom===e.item):"String"===s?this.targetDom.querySelector(e.item):e.item;if(!i||this.unbounds.includes(i.dom))return!1;let o=this.getEdgeValue(e.value,i),a=this.computeHYP(i.now,o).HYP/this.hypotenuse,n=e.duration||0==e.duration?`${e.duration}ms`:a>1?Math.trunc(this.options.duration*a)+"ms":`${this.options.duration}ms`;if(JSON.stringify(o)==JSON.stringify(i.now))return!1;i.dom.style.transitionDuration=n,this.setValues({value:o,item:i}),setTimeout(()=>{this.handlers.hasOwnProperty("slided")&&this.emit("slided",{raw:e.value,correction:o,item:i}),this.options.onSlided&&this.options.onSlided.call(this,{raw:e.value,correction:o,item:i}),e.callback&&e.callback.call(this,{raw:e.value,correction:o,item:i})},parseInt(n))}getCoordValue(t){return this.isMobi?{x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY}:{x:t.clientX,y:t.clientY}}updateTarget(){let t=axStyle(this.targetDom),e=this.targetDom.getBoundingClientRect().height-(parseInt(t.borderTopWidth)+parseInt(t.borderBottomWidth)+parseInt(t.paddingTop)+parseInt(t.paddingBottom)),s=this.targetDom.getBoundingClientRect().width-(parseInt(t.borderLeftWidth)+parseInt(t.borderRightWidth)+parseInt(t.paddingLeft)+parseInt(t.paddingRight)),i=this.computeHYP({x:0,y:0},{x:s,y:e}).HYP;this.targetHeight!=e&&(this.targetHeight=e),this.targetWidth!=s&&(this.targetWidth=s),this.hypotenuse!=i&&(this.hypotenuse=i)}updateItem(t=this.slides[0]){let e=axType(t),s=e.includes("HTML")?this.slides.find(e=>e.dom===t):"String"===e?this.targetDom.querySelector(t):t;if(!s||this.unbounds.includes(s.dom))return!1;s.size.height=s.dom.getBoundingClientRect().height,s.size.width=s.dom.getBoundingClientRect().width,s.difference={x:this.targetWidth-s.size.width,y:this.targetHeight-s.size.height},s.offset={x:s.dom.offsetLeft,y:s.dom.offsetTop},s.difference.x>0&&s.difference.y>0?s.shape="baby":s.difference.y>0&&s.difference.x<=0?s.shape="river":s.difference.x>0&&s.difference.y<=0?s.shape="chimney":s.shape="cover",this.fixedTranslate(s)}getScaleOffset(t){return t.scale>this.options.scale.min?{x:t.size.width/t.scale/2*(t.scale-1),y:t.size.height/t.scale/2*(t.scale-1)}:{x:0,y:0}}fixedTranslate(t){let e=this.getValues(t),s={x:e[4],y:e[5]},i=this.getScaleOffset(t),o=e=>{t.offset[e]-i[e]+s[e]<0?s[e]=-t.offset[e]+i[e]:t.offset[e]-i[e]+s[e]>t.difference[e]&&(s[e]=t.difference[e]-t.offset[e]+i[e]),t.range[e]=[0-t.offset[e]+i[e],t.difference[e]-t.offset[e]+i[e]]},a=e=>{s[e]-t.offset[e]+i[e]&&(s[e]=-t.offset[e]+i[e]),t.range[e]=[t.difference[e]-t.offset[e]+i[e],-t.offset[e]+i[e]]};switch(t.shape){case"baby":o("x"),o("y");break;case"river":o("y"),a("x");break;case"chimney":o("x"),a("y");break;default:a("x"),a("y")}JSON.stringify(s)!=JSON.stringify(t.now)&&this.setValues({value:s,item:t})}response(t="all"){if(this.destroyed)return this;if("all"===t)this.updateTarget(),this.slides.forEach(t=>{this.updateItem(t)});else if("parent"===t)this.updateTarget();else if("chidren"===t)this.slides.forEach(t=>{this.updateItem(t)});else{let e=axType(t),s=e.includes("HTML")?this.slides.find(e=>e.dom===t):"String"===e?this.targetDom.querySelector(t):t;s&&this.updateItem(s)}}getValues(t=this.slides[0]){let e=axType(t),s=e.includes("HTML")?this.slides.find(e=>e.dom===t):"String"===e?this.targetDom.querySelector(t):t;if(!s)return!1;let i=axStyle(s.dom).transform;return"none"===i?[1,0,0,1,0,0]:i.replace(/[^0-9.\-,]/g,"").split(",").map(t=>Number(t))}setValues(t){if(this.destroyed)return this;let e=Object.assign({item:this.slides[0],type:"translate",apply:!0},t),s=axType(e.item),i=s.includes("HTML")?this.slides.find(t=>t.dom===e.item):"String"===s?this.targetDom.querySelector(e.item):e.item;if(!i||this.unbounds.includes(i.dom))return!1;let o=this.getValues(i),a=[...o],n=axType(e.value),r={};if("Object"===n)r={...e.value};else if("Number"===n)r={x:e.value,y:e.value};else{let t=~~e.value;t||(t="scale"===e.type?1:0),r={x:t,y:t}}"zero"===e.type?(a[0]=1,a[3]=1,a[4]=0,a[5]=0):"scale"===e.type?(a[0]=r.x,a[3]=r.y):(a[4]=r.x,a[5]=r.y),JSON.stringify(a)!=JSON.stringify(o)&&(i.dom.style.transform=`matrix(${a.join()})`,e.apply&&("zero"===e.type?(i.last={x:0,y:0},i.now={x:0,y:0},i.scale=1):"scale"===e.type?i.scale=r.x||r.y:(i.last={...r},i.now={...r})))}reset(){if(this.destroyed)return this;this.slides.forEach(t=>{this.setValues({type:"zero",item:t}),t.dom.style.cssText=t.dom.style.cssText.replace("transition-duration: 0ms","")}),this.targetDom.removeAttribute("moving"),this.started=!1}addItemEvent(t){t.addEventListener(this.events[0],this.startFun),t.addEventListener(this.events[1],this.moveFun),t.addEventListener(this.events[2],this.endFun),!this.isMobi&&this.options.scale.enable&&t.addEventListener(this.scrollObj.event,this.scrollFun),this.mutationObs.observe(t,{attributes:!0,attributeFilter:["style"]}),t.addEventListener("transitionend",this.slidedEvent),this.slideDomSizeObserver.observe(t)}removeItemEvent(t){t.removeEventListener(this.events[0],this.startFun),t.removeEventListener(this.events[1],this.moveFun),t.removeEventListener(this.events[2],this.endFun),!this.isMobi&&this.options.scale.enable&&t.removeEventListener(this.scrollObj.event,this.scrollFun),t.removeEventListener("transitionend",this.slidedEvent),this.slideDomSizeObserver.unobserve(t)}addTargetEvent(){this.isMobi?this.targetDom.addEventListener("touchcancel",this.endFun):this.targetDom.addEventListener("mouseleave",this.endFun),this.mutationObs.observe(this.targetDom,{childList:!0}),this.targetDomSizeObserver.observe(this.targetDom)}removeTargetEvent(){this.isMobi||this.targetDom.removeEventListener("mouseleave",this.endFun),this.targetDomSizeObserver.unobserve(this.targetDom)}add(t,e){let s=axGetDoms(t),i=[];return 0!==s.length&&(i=s.filter(Boolean).map(t=>{let e=this.slides.find(e=>e.dom===t),s=null;return e&&e.disabled?(Reflect.deleteProperty(e,"disabled"),e.dom.removeAttribute("disabled"),s=t,this.addItemEvent(t)):(s={dom:t,last:{x:0,y:0},now:{x:0,y:0},difference:{x:0,y:0},size:{width:0,height:0},offset:{x:0,y:0},shape:"",range:{x:[],y:[]},scale:1},this.addItemEvent(t),this.slides.push(s)),s}),this.handlers.hasOwnProperty("add")&&this.emit("add",i),this.options.onAdd&&this.options.onAdd.call(this,i),e&&e.call(this,i),this)}remove(t,e){let s=axGetDoms(t),i=this.slides.filter(t=>!t.disabled&&s.includes(t.dom));return 0!==s.length&&(i.forEach(t=>{t.disabled=!0,t.dom.setAttribute("disabled",""),this.removeItemEvent(t.dom)}),this.handlers.hasOwnProperty("remove")&&this.emit("remove",i),this.options.onRemove&&this.options.onRemove.call(this,i),e&&e.call(this,i),this)}update(t,e){return this.destroyed?this:(this.options=axExtend(this.options,t),this.reset(),this.options.init&&this.init(),this.handlers.hasOwnProperty("updated")&&this.emit("updated",""),this.options.onUpdated&&this.options.onUpdated.call(this),e&&e.call(this),this)}destroy(t){return this.destroyed?this:(this.reset(),this.slides.forEach(t=>{this.removeItemEvent(t.dom)}),this.removeTargetEvent(),this.destroyed=!0,this.handlers.hasOwnProperty("destroy")&&this.emit("destroy",""),this.options.onDestroy&&this.options.onDestroy.call(this),t&&t.call(this),this)}on(t,e){return axAddPlan(t,e,this),this}emit(t,...e){axExePlan(t,this,...e)}off(t,e){return axDelPlan(t,e,this),this}}class axTow{constructor(t,e){return this.targetDom=axIdToDom(t),!!this.targetDom&&(this.options=axExtend({insName:"",parent:document,onInit:"",onStart:null,onMove:null,onEnd:null,onDestroy:""},e,this.targetDom,this.constructor.name),this.parentDom=axIdToDom(this.options.parent),!!this.parentDom&&(this.handlers={},this.coord={x:0,y:0},this.diff={x:0,y:0},this.startFun=(t=>{this.coord=axGetClientObj(t),this.parentDom.addEventListener(axEventMap[1],this.moveFun,{passive:!1}),this.parentDom.addEventListener(axEventMap[2],this.endFun,{passive:!1});let e={target:t.target,coord:this.coord,diff:this.diff,originEvent:t};this.handlers.hasOwnProperty("start")&&this.emit("start",e),this.options.onStart&&this.options.onStart.call(this,e)}),this.moveFun=(t=>{let e=axGetClientObj(t);this.diff={x:e.x-this.coord.x,y:e.y-this.coord.y};let s={target:t.target,coord:e,diff:this.diff,originEvent:t};this.handlers.hasOwnProperty("move")&&this.emit("move",s),this.options.onMove&&this.options.onMove.call(this,s)}),this.endFun=(t=>{this.coord=axGetClientObj(t);let e={target:t.target,coord:this.coord,diff:this.diff,originEvent:t};this.handlers.hasOwnProperty("end")&&this.emit("end",e),this.options.onEnd&&this.options.onEnd.call(this,e),this.setCompleted()}),this.cancelFun=(t=>{this.setCompleted(),this.handlers.hasOwnProperty("cancel")&&this.emit("cancel",{target:t.target,coord:this.coord,diff:this.diff}),this.options.onCancel&&this.options.onCancel.call(this,{target:t.target,coord:this.coord,diff:this.diff})}),void this.init()))}init(){return axInstance.push(this,this.options.insName,"tow"),this.destroyed=!1,this.targetDom.removeEventListener(axEventMap[0],this.startFun),this.targetDom.addEventListener(axEventMap[0],this.startFun,{passive:!1}),this.parentDom.addEventListener(axEventMap[3],this.cancelFun,{passive:!1}),this.handlers.hasOwnProperty("init")&&this.emit("init",""),this.options.onInit&&this.options.onInit.call(this),this}setCompleted(){this.diff={x:0,y:0},this.parentDom.removeEventListener(axEventMap[1],this.moveFun),this.parentDom.removeEventListener(axEventMap[2],this.endFun)}destroy(t){return this.destroyed?this:(this.setCompleted(),this.targetDom.removeEventListener(axEventMap[0],this.startFun),this.parentDom.removeEventListener(axEventMap[3],this.cancelFun),this.destroyed=!0,this.handlers.hasOwnProperty("destroy")&&this.emit("destroy",""),this.options.onDestroy&&this.options.onDestroy.call(this),t&&t.call(this),this)}on(t,e){return axAddPlan(t,e,this),this}emit(t,...e){axExePlan(t,this,...e)}off(t,e){return axDelPlan(t,e,this),this}}(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self,t.axSwiper=e())})(this,function(){function t(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function e(s,i){void 0===s&&(s={}),void 0===i&&(i={}),Object.keys(i).forEach(o=>{void 0===s[o]?s[o]=i[o]:t(i[o])&&t(s[o])&&Object.keys(i[o]).length>0&&e(s[o],i[o])})}function s(){const t="undefined"!=typeof document?document:{};return e(t,Be),t}function i(){const t="undefined"!=typeof window?window:{};return e(t,Ve),t}function o(t){const e=t.__proto__;Object.defineProperty(t,"__proto__",{get:()=>e,set(t){e.__proto__=t}})}function a(t){void 0===t&&(t=[]);const e=[];return t.forEach(t=>{Array.isArray(t)?e.push(...a(t)):e.push(t)}),e}function n(t,e){return Array.prototype.filter.call(t,e)}function r(t){const e=[];for(let s=0;s=0&&s.indexOf(">")>=0){let t="div";0===s.indexOf("t.split(" ")));return this.forEach(t=>{t.classList.add(...i)}),this}function p(){for(var t=arguments.length,e=new Array(t),s=0;st.split(" ")));return this.forEach(t=>{t.classList.remove(...i)}),this}function c(){for(var t=arguments.length,e=new Array(t),s=0;st.split(" ")));this.forEach(t=>{i.forEach(e=>{t.classList.toggle(e)})})}function u(){for(var t=arguments.length,e=new Array(t),s=0;st.split(" ")));return n(this,t=>i.filter(e=>t.classList.contains(e)).length>0).length>0}function m(t,e){if(1===arguments.length&&"string"==typeof t)return this[0]?this[0].getAttribute(t):void 0;for(let s=0;s=0;t-=1){const o=i[t];a&&o.listener===a?(s.removeEventListener(e,o.proxyListener,n),i.splice(t,1)):a&&o.listener&&o.listener.dom7proxy&&o.listener.dom7proxy===a?(s.removeEventListener(e,o.proxyListener,n),i.splice(t,1)):a||(s.removeEventListener(e,o.proxyListener,n),i.splice(t,1))}}}return this}function v(){const t=i();for(var e=arguments.length,s=new Array(e),o=0;oe>0),o.dispatchEvent(e),o.dom7EventData=[],delete o.dom7EventData}}}return this}function D(t){function e(i){i.target===this&&(t.call(this,i),s.off("transitionend",e))}const s=this;return t&&s.on("transitionend",e),this}function w(t){if(this.length>0){if(t){const t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null}function T(t){if(this.length>0){if(t){const t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null}function S(){if(this.length>0){const t=i(),e=s(),o=this[0],a=o.getBoundingClientRect(),n=e.body,r=o.clientTop||n.clientTop||0,l=o.clientLeft||n.clientLeft||0,h=o===t?t.scrollY:o.scrollTop,d=o===t?t.scrollX:o.scrollLeft;return{top:a.top+h-r,left:a.left+d-l}}return null}function E(){const t=i();return this[0]?t.getComputedStyle(this[0],null):{}}function A(t,e){const s=i();let o;if(1===arguments.length){if("string"!=typeof t){for(o=0;o{t.apply(e,[e,s])}),this):this}function I(t){const e=n(this,t);return h(e)}function k(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(let e=0;ee-1)return h([]);if(t<0){const s=e+t;return h(s<0?[]:[this[s]])}return h([this[t]])}function O(){let t;const e=s();for(let s=0;s=0;o-=1)this[i].insertBefore(s.childNodes[o],this[i].childNodes[0])}else if(t instanceof Fe)for(o=0;o0?t?this[0].nextElementSibling&&h(this[0].nextElementSibling).is(t)?h([this[0].nextElementSibling]):h([]):this[0].nextElementSibling?h([this[0].nextElementSibling]):h([]):h([])}function H(t){const e=[];let s=this[0];if(!s)return h([]);for(;s.nextElementSibling;){const i=s.nextElementSibling;t?h(i).is(t)&&e.push(i):e.push(i),s=i}return h(e)}function q(t){if(this.length>0){const e=this[0];return t?e.previousElementSibling&&h(e.previousElementSibling).is(t)?h([e.previousElementSibling]):h([]):e.previousElementSibling?h([e.previousElementSibling]):h([])}return h([])}function R(t){const e=[];let s=this[0];if(!s)return h([]);for(;s.previousElementSibling;){const i=s.previousElementSibling;t?h(i).is(t)&&e.push(i):e.push(i),s=i}return h(e)}function B(t){const e=[];for(let s=0;s{try{e[t]=null}catch(t){}try{delete e[t]}catch(t){}})}function X(t,e){return void 0===e&&(e=0),setTimeout(t,e)}function G(){return Date.now()}function _(t){const e=i();let s;return e.getComputedStyle&&(s=e.getComputedStyle(t,null)),!s&&t.currentStyle&&(s=t.currentStyle),s||(s=t.style),s}function J(t,e){void 0===e&&(e="x");const s=i();let o,a,n;const r=_(t);return s.WebKitCSSMatrix?(a=r.transform||r.webkitTransform,a.split(",").length>6&&(a=a.split(", ").map(t=>t.replace(",",".")).join(", ")),n=new s.WebKitCSSMatrix("none"===a?"":a)):(n=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),o=n.toString().split(",")),"x"===e&&(a=s.WebKitCSSMatrix?n.m41:16===o.length?parseFloat(o[12]):parseFloat(o[4])),"y"===e&&(a=s.WebKitCSSMatrix?n.m42:16===o.length?parseFloat(o[13]):parseFloat(o[5])),a||0}function Z(t){return"object"==typeof t&&null!==t&&t.constructor&&"Object"===Object.prototype.toString.call(t).slice(8,-1)}function K(t){return"undefined"!=typeof window&&void 0!==window.HTMLElement?t instanceof HTMLElement:t&&(1===t.nodeType||11===t.nodeType)}function Q(){const t=Object(arguments.length<=0?void 0:arguments[0]),e=["__proto__","constructor","prototype"];for(let s=1;se.indexOf(t)<0);for(let e=0,o=s.length;en?"next":"prev",p=(t,e)=>"next"===d&&t>=e||"prev"===d&&t<=e,c=()=>{r=(new Date).getTime(),null===l&&(l=r);const t=Math.max(Math.min((r-l)/h,1),0),i=.5-Math.cos(t*Math.PI)/2;let d=n+i*(s-n);if(p(d,s)&&(d=s),e.wrapperEl.scrollTo({[o]:d}),p(d,s))return e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[o]:d})}),void a.cancelAnimationFrame(e.cssModeFrameID);e.cssModeFrameID=a.requestAnimationFrame(c)};c()}function st(){const t=i(),e=s();return{smoothScroll:e.documentElement&&"scrollBehavior"in e.documentElement.style,touch:!!("ontouchstart"in t||t.DocumentTouch&&e instanceof t.DocumentTouch),passiveListener:function(){let e=!1;try{const s=Object.defineProperty({},"passive",{get(){e=!0}});t.addEventListener("testPassiveListener",null,s)}catch(t){}return e}(),gestures:"ongesturestart"in t}}function it(){return Ye||(Ye=st()),Ye}function ot(t){let{userAgent:e}=void 0===t?{}:t;const s=it(),o=i(),a=o.navigator.platform,n=e||o.navigator.userAgent,r={ios:!1,android:!1},l=o.screen.width,h=o.screen.height,d=n.match(/(Android);?[\s\/]+([\d.]+)?/);let p=n.match(/(iPad).*OS\s([\d_]+)/);const c=n.match(/(iPod)(.*OS\s([\d_]+))?/),u=!p&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),m="Win32"===a;let g="MacIntel"===a;const f=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!p&&g&&s.touch&&f.indexOf(`${l}x${h}`)>=0&&(p=n.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),g=!1),d&&!m&&(r.os="android",r.android=!0),(p||u||c)&&(r.os="ios",r.ios=!0),r}function at(t){return void 0===t&&(t={}),Ue||(Ue=ot(t)),Ue}function nt(){function t(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}const e=i();return{isSafari:t(),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}function rt(){return We||(We=nt()),We}function lt(t){let{swiper:e,on:s,emit:o}=t;const a=i();let n=null,r=null;const l=()=>{e&&!e.destroyed&&e.initialized&&(o("beforeResize"),o("resize"))},h=()=>{e&&!e.destroyed&&e.initialized&&(n=new ResizeObserver(t=>{r=a.requestAnimationFrame(()=>{const{width:s,height:i}=e;let o=s,a=i;t.forEach(t=>{let{contentBoxSize:s,contentRect:i,target:n}=t;n&&n!==e.el||(o=i?i.width:(s[0]||s).inlineSize,a=i?i.height:(s[0]||s).blockSize)}),o===s&&a===i||l()})}),n.observe(e.el))},d=()=>{r&&a.cancelAnimationFrame(r),n&&n.unobserve&&e.el&&(n.unobserve(e.el),n=null)},p=()=>{e&&!e.destroyed&&e.initialized&&o("orientationchange")};s("init",()=>{e.params.resizeObserver&&void 0!==a.ResizeObserver?h():(a.addEventListener("resize",l),a.addEventListener("orientationchange",p))}),s("destroy",()=>{d(),a.removeEventListener("resize",l),a.removeEventListener("orientationchange",p)})}function ht(t){let{swiper:e,extendParams:s,on:o,emit:a}=t;const n=[],r=i(),l=function(t,e){void 0===e&&(e={});const s=r.MutationObserver||r.WebkitMutationObserver,i=new s(t=>{if(1===t.length)return void a("observerUpdate",t[0]);const e=function(){a("observerUpdate",t[0])};r.requestAnimationFrame?r.requestAnimationFrame(e):r.setTimeout(e,0)});i.observe(t,{attributes:void 0===e.attributes||e.attributes,childList:void 0===e.childList||e.childList,characterData:void 0===e.characterData||e.characterData}),n.push(i)},h=()=>{if(e.params.observer){ if(e.params.observeParents){const t=e.$el.parents();for(let e=0;e{n.forEach(t=>{t.disconnect()}),n.splice(0,n.length)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),o("init",h),o("destroy",d)}function dt(){const t=this;let e,s;const i=t.$el;e=void 0!==t.params.width&&null!==t.params.width?t.params.width:i[0].clientWidth,s=void 0!==t.params.height&&null!==t.params.height?t.params.height:i[0].clientHeight,0===e&&t.isHorizontal()||0===s&&t.isVertical()||(e=e-parseInt(i.css("padding-left")||0,10)-parseInt(i.css("padding-right")||0,10),s=s-parseInt(i.css("padding-top")||0,10)-parseInt(i.css("padding-bottom")||0,10),Number.isNaN(e)&&(e=0),Number.isNaN(s)&&(s=0),Object.assign(t,{width:e,height:s,size:t.isHorizontal()?e:s}))}function pt(){function t(t){return s.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}function e(e,s){return parseFloat(e.getPropertyValue(t(s))||0)}const s=this,i=s.params,{$wrapperEl:o,size:a,rtlTranslate:n,wrongRTL:r}=s,l=s.virtual&&i.virtual.enabled,h=l?s.virtual.slides.length:s.slides.length,d=o.children(`.${s.params.slideClass}`),p=l?s.virtual.slides.length:d.length;let c=[];const u=[],m=[];let g=i.slidesOffsetBefore;"function"==typeof g&&(g=i.slidesOffsetBefore.call(s));let f=i.slidesOffsetAfter;"function"==typeof f&&(f=i.slidesOffsetAfter.call(s));const x=s.snapGrid.length,y=s.slidesGrid.length;let b=i.spaceBetween,v=-g,D=0,w=0;if(void 0===a)return;"string"==typeof b&&b.indexOf("%")>=0&&(b=parseFloat(b.replace("%",""))/100*a),s.virtualSize=-b,n?d.css({marginLeft:"",marginBottom:"",marginTop:""}):d.css({marginRight:"",marginBottom:"",marginTop:""}),i.centeredSlides&&i.cssMode&&(tt(s.wrapperEl,"--swiper-centered-offset-before",""),tt(s.wrapperEl,"--swiper-centered-offset-after",""));const T=i.grid&&i.grid.rows>1&&s.grid;let S;T&&s.grid.initSlides(p);const E="auto"===i.slidesPerView&&i.breakpoints&&Object.keys(i.breakpoints).filter(t=>void 0!==i.breakpoints[t].slidesPerView).length>0;for(let o=0;o1&&c.push(s.virtualSize-a)}if(0===c.length&&(c=[0]),0!==i.spaceBetween){const e=s.isHorizontal()&&n?"marginLeft":t("marginRight");d.filter((t,e)=>!i.cssMode||e!==d.length-1).css({[e]:`${b}px`})}if(i.centeredSlides&&i.centeredSlidesBounds){let t=0;m.forEach(e=>{t+=e+(i.spaceBetween?i.spaceBetween:0)}),t-=i.spaceBetween;const e=t-a;c=c.map(t=>t<0?-g:t>e?e+f:t)}if(i.centerInsufficientSlides){let t=0;if(m.forEach(e=>{t+=e+(i.spaceBetween?i.spaceBetween:0)}),t-=i.spaceBetween,t{c[s]=t-e}),u.forEach((t,s)=>{u[s]=t+e})}}if(Object.assign(s,{slides:d,snapGrid:c,slidesGrid:u,slidesSizesGrid:m}),i.centeredSlides&&i.cssMode&&!i.centeredSlidesBounds){tt(s.wrapperEl,"--swiper-centered-offset-before",`${-c[0]}px`),tt(s.wrapperEl,"--swiper-centered-offset-after",`${s.size/2-m[m.length-1]/2}px`);const t=-s.snapGrid[0],e=-s.slidesGrid[0];s.snapGrid=s.snapGrid.map(e=>e+t),s.slidesGrid=s.slidesGrid.map(t=>t+e)}if(p!==h&&s.emit("slidesLengthChange"),c.length!==x&&(s.params.watchOverflow&&s.checkOverflow(),s.emit("snapGridLengthChange")),u.length!==y&&s.emit("slidesGridLengthChange"),i.watchSlidesProgress&&s.updateSlidesOffset(),!(l||i.cssMode||"slide"!==i.effect&&"fade"!==i.effect)){const t=`${i.containerModifierClass}backface-hidden`,e=s.$el.hasClass(t);p<=i.maxBackfaceHiddenSlides?e||s.$el.addClass(t):e&&s.$el.removeClass(t)}}function ct(t){const e=this,s=[],i=e.virtual&&e.params.virtual.enabled;let o,a=0;"number"==typeof t?e.setTransition(t):!0===t&&e.setTransition(e.params.speed);const n=t=>i?e.slides.filter(e=>parseInt(e.getAttribute("data-swiper-slide-index"),10)===t)[0]:e.slides.eq(t)[0];if("auto"!==e.params.slidesPerView&&e.params.slidesPerView>1)if(e.params.centeredSlides)e.visibleSlides.each(t=>{s.push(t)});else for(o=0;oe.slides.length&&!i)break;s.push(n(t))}else s.push(n(e.activeIndex));for(o=0;oa?t:a}(a||0===a)&&e.$wrapperEl.css("height",`${a}px`)}function ut(){const t=this,e=t.slides;for(let s=0;s=0&&p1&&c<=e.size||p<=0&&c>=e.size;u&&(e.visibleSlides.push(r),e.visibleSlidesIndexes.push(t),i.eq(t).addClass(s.slideVisibleClass)),r.progress=o?-h:h,r.originalProgress=o?-d:d}e.visibleSlides=h(e.visibleSlides)}function gt(t){const e=this;if(void 0===t){const s=e.rtlTranslate?-1:1;t=e&&e.translate&&e.translate*s||0}const s=e.params,i=e.maxTranslate()-e.minTranslate();let{progress:o,isBeginning:a,isEnd:n}=e;const r=a,l=n;0===i?(o=0,a=!0,n=!0):(o=(t-e.minTranslate())/i,a=o<=0,n=o>=1),Object.assign(e,{progress:o,isBeginning:a,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&e.updateSlidesProgress(t),a&&!r&&e.emit("reachBeginning toEdge"),n&&!l&&e.emit("reachEnd toEdge"),(r&&!a||l&&!n)&&e.emit("fromEdge"),e.emit("progress",o)}function ft(){const t=this,{slides:e,params:s,$wrapperEl:i,activeIndex:o,realIndex:a}=t,n=t.virtual&&s.virtual.enabled;let r;e.removeClass(`${s.slideActiveClass} ${s.slideNextClass} ${s.slidePrevClass} ${s.slideDuplicateActiveClass} ${s.slideDuplicateNextClass} ${s.slideDuplicatePrevClass}`),r=n?t.$wrapperEl.find(`.${s.slideClass}[data-swiper-slide-index="${o}"]`):e.eq(o),r.addClass(s.slideActiveClass),s.loop&&(r.hasClass(s.slideDuplicateClass)?i.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${a}"]`).addClass(s.slideDuplicateActiveClass):i.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${a}"]`).addClass(s.slideDuplicateActiveClass));let l=r.nextAll(`.${s.slideClass}`).eq(0).addClass(s.slideNextClass);s.loop&&0===l.length&&(l=e.eq(0),l.addClass(s.slideNextClass));let h=r.prevAll(`.${s.slideClass}`).eq(0).addClass(s.slidePrevClass);s.loop&&0===h.length&&(h=e.eq(-1),h.addClass(s.slidePrevClass)),s.loop&&(l.hasClass(s.slideDuplicateClass)?i.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${l.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass):i.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${l.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicateNextClass),h.hasClass(s.slideDuplicateClass)?i.children(`.${s.slideClass}:not(.${s.slideDuplicateClass})[data-swiper-slide-index="${h.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass):i.children(`.${s.slideClass}.${s.slideDuplicateClass}[data-swiper-slide-index="${h.attr("data-swiper-slide-index")}"]`).addClass(s.slideDuplicatePrevClass)),t.emitSlidesClasses()}function xt(t){const e=this,s=e.rtlTranslate?e.translate:-e.translate,{slidesGrid:i,snapGrid:o,params:a,activeIndex:n,realIndex:r,snapIndex:l}=e;let h,d=t;if(void 0===d){for(let t=0;t=i[t]&&s=i[t]&&s=i[t]&&(d=t);a.normalizeSlideIndex&&(d<0||void 0===d)&&(d=0)}if(o.indexOf(s)>=0)h=o.indexOf(s);else{const t=Math.min(a.slidesPerGroupSkip,d);h=t+Math.floor((d-t)/a.slidesPerGroup)}if(h>=o.length&&(h=o.length-1),d===n)return void(h!==l&&(e.snapIndex=h,e.emit("snapIndexChange")));const p=parseInt(e.slides.eq(d).attr("data-swiper-slide-index")||d,10);Object.assign(e,{snapIndex:h,realIndex:p,previousIndex:n,activeIndex:d}),e.emit("activeIndexChange"),e.emit("snapIndexChange"),r!==p&&e.emit("realIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&e.emit("slideChange")}function yt(t){const e=this,s=e.params,i=h(t).closest(`.${s.slideClass}`)[0];let o,a=!1;if(i)for(let t=0;tl?l:i&&tn?"next":a=l.length&&(f=l.length-1),(p||r.initialSlide||0)===(d||0)&&s&&a.emit("beforeSlideChangeStart");const x=-l[f];if(a.updateProgress(x),r.normalizeSlideIndex)for(let t=0;t=s&&e=s&&e=s&&(n=t)}if(a.initialized&&n!==p){if(!a.allowSlideNext&&xa.translate&&x>a.maxTranslate()&&(p||0)!==n)return!1}let y;if(y=n>p?"next":n{a.wrapperEl.style.scrollSnapType="",a._swiperImmediateVirtual=!1})}else{if(!a.support.smoothScroll)return et({swiper:a,targetPosition:s,side:t?"left":"top"}),!0;u.scrollTo({[t?"left":"top"]:s,behavior:"smooth"})}return!0}return a.setTransition(e),a.setTranslate(x),a.updateActiveIndex(n),a.updateSlidesClasses(),a.emit("beforeTransitionStart",e,i),a.transitionStart(s,y),0===e?a.transitionEnd(s,y):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(t){a&&!a.destroyed&&t.target===this&&(a.$wrapperEl[0].removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.$wrapperEl[0].removeEventListener("webkitTransitionEnd",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(s,y))}),a.$wrapperEl[0].addEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.$wrapperEl[0].addEventListener("webkitTransitionEnd",a.onSlideToWrapperTransitionEnd)),!0}function kt(t,e,s,i){void 0===t&&(t=0),void 0===e&&(e=this.params.speed),void 0===s&&(s=!0);const o=this;let a=t;return o.params.loop&&(a+=o.loopedSlides),o.slideTo(a,e,s,i)}function Mt(t,e,s){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0);const i=this,{animating:o,enabled:a,params:n}=i;if(!a)return i;let r=n.slidesPerGroup;"auto"===n.slidesPerView&&1===n.slidesPerGroup&&n.slidesPerGroupAuto&&(r=Math.max(i.slidesPerViewDynamic("current",!0),1));const l=i.activeIndexi(t));let m=r[u.indexOf(c)-1];if(void 0===m&&a.cssMode){let t;r.forEach((e,s)=>{c>=e&&(t=s)}),void 0!==t&&(m=r[t>0?t-1:t])}let g=0;if(void 0!==m&&(g=l.indexOf(m),g<0&&(g=o.activeIndex-1),"auto"===a.slidesPerView&&1===a.slidesPerGroup&&a.slidesPerGroupAuto&&(g=g-o.slidesPerViewDynamic("previous",!0)+1,g=Math.max(g,0))),a.rewind&&o.isBeginning){const i=o.params.virtual&&o.params.virtual.enabled&&o.virtual?o.virtual.slides.length-1:o.slides.length-1;return o.slideTo(i,t,e,s)}return o.slideTo(g,t,e,s)}function Pt(t,e,s){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0);const i=this;return i.slideTo(i.activeIndex,t,e,s)}function $t(t,e,s,i){void 0===t&&(t=this.params.speed),void 0===e&&(e=!0),void 0===i&&(i=.5);const o=this;let a=o.activeIndex;const n=Math.min(o.params.slidesPerGroupSkip,a),r=n+Math.floor((a-n)/o.params.slidesPerGroup),l=o.rtlTranslate?o.translate:-o.translate;if(l>=o.snapGrid[r]){const t=o.snapGrid[r],e=o.snapGrid[r+1];l-t>(e-t)*i&&(a+=o.params.slidesPerGroup)}else{const t=o.snapGrid[r-1],e=o.snapGrid[r];l-t<=(e-t)*i&&(a-=o.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,o.slidesGrid.length-1),o.slideTo(a,t,e,s)}function Ot(){const t=this,{params:e,$wrapperEl:s}=t,i="auto"===e.slidesPerView?t.slidesPerViewDynamic():e.slidesPerView;let o,a=t.clickedIndex;if(e.loop){if(t.animating)return;o=parseInt(h(t.clickedSlide).attr("data-swiper-slide-index"),10),e.centeredSlides?at.slides.length-t.loopedSlides+i/2?(t.loopFix(),a=s.children(`.${e.slideClass}[data-swiper-slide-index="${o}"]:not(.${e.slideDuplicateClass})`).eq(0).index(),X(()=>{t.slideTo(a)})):t.slideTo(a):a>t.slides.length-i?(t.loopFix(),a=s.children(`.${e.slideClass}[data-swiper-slide-index="${o}"]:not(.${e.slideDuplicateClass})`).eq(0).index(),X(()=>{t.slideTo(a)})):t.slideTo(a)}else t.slideTo(a)}function Nt(){const t=this,e=s(),{params:i,$wrapperEl:o}=t,a=o.children().length>0?h(o.children()[0].parentNode):o;a.children(`.${i.slideClass}.${i.slideDuplicateClass}`).remove();let n=a.children(`.${i.slideClass}`);if(i.loopFillGroupWithBlank){const t=i.slidesPerGroup-n.length%i.slidesPerGroup;if(t!==i.slidesPerGroup){for(let s=0;sn.length&&(t.loopedSlides=n.length);const r=[],l=[];n.each((e,s)=>{const i=h(e);s=n.length-t.loopedSlides&&r.push(e),i.attr("data-swiper-slide-index",s)});for(let t=0;t=0;t-=1)a.prepend(h(r[t].cloneNode(!0)).addClass(i.slideDuplicateClass))}function zt(){const t=this;t.emit("beforeLoopFix");const{activeIndex:e,slides:s,loopedSlides:i,allowSlidePrev:o,allowSlideNext:a,snapGrid:n,rtlTranslate:r}=t;let l;t.allowSlidePrev=!0,t.allowSlideNext=!0;const h=-n[e],d=h-t.getTranslate();if(e=s.length-i){l=-s.length+e+i,l+=i;const o=t.slideTo(l,0,!1,!0);o&&0!==d&&t.setTranslate((r?-t.translate:t.translate)-d)}t.allowSlidePrev=o,t.allowSlideNext=a,t.emit("loopFix")}function Ht(){const t=this,{$wrapperEl:e,params:s,slides:i}=t;e.children(`.${s.slideClass}.${s.slideDuplicateClass},.${s.slideClass}.${s.slideBlankClass}`).remove(),i.removeAttr("data-swiper-slide-index")}function qt(t){const e=this;if(e.support.touch||!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const s="container"===e.params.touchEventsTarget?e.el:e.wrapperEl;s.style.cursor="move",s.style.cursor=t?"grabbing":"grab"}function Rt(){const t=this;t.support.touch||t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t["container"===t.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="")}function Bt(t,e){function o(e){if(!e||e===s()||e===i())return null;e.assignedSlot&&(e=e.assignedSlot);const a=e.closest(t);return a||o(e.getRootNode().host)}return void 0===e&&(e=this),o(e)}function Vt(t){const e=this,o=s(),a=i(),n=e.touchEventsData,{params:r,touches:l,enabled:d}=e;if(!d)return;if(e.animating&&r.preventInteractionOnTransition)return;!e.animating&&r.cssMode&&r.loop&&e.loopFix();let p=t;p.originalEvent&&(p=p.originalEvent);let c=h(p.target);if("wrapper"===r.touchEventsTarget&&!c.closest(e.wrapperEl).length)return;if(n.isTouchEvent="touchstart"===p.type,!n.isTouchEvent&&"which"in p&&3===p.which)return;if(!n.isTouchEvent&&"button"in p&&p.button>0)return;if(n.isTouched&&n.isMoved)return;const u=!!r.noSwipingClass&&""!==r.noSwipingClass;u&&p.target&&p.target.shadowRoot&&t.path&&t.path[0]&&(c=h(t.path[0]));const m=r.noSwipingSelector?r.noSwipingSelector:`.${r.noSwipingClass}`,g=!(!p.target||!p.target.shadowRoot);if(r.noSwiping&&(g?Bt(m,p.target):c.closest(m)[0]))return void(e.allowClick=!0);if(r.swipeHandler&&!c.closest(r.swipeHandler)[0])return;l.currentX="touchstart"===p.type?p.targetTouches[0].pageX:p.pageX,l.currentY="touchstart"===p.type?p.targetTouches[0].pageY:p.pageY;const f=l.currentX,x=l.currentY,y=r.edgeSwipeDetection||r.iOSEdgeSwipeDetection,b=r.edgeSwipeThreshold||r.iOSEdgeSwipeThreshold;if(y&&(f<=b||f>=a.innerWidth-b)){if("prevent"!==y)return;axPreventDefault(t)}if(Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),l.startX=f,l.startY=x,n.touchStartTime=G(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,r.threshold>0&&(n.allowThresholdMove=!1),"touchstart"!==p.type){let t=!0;c.is(n.focusableElements)&&(t=!1,"SELECT"===c[0].nodeName&&(n.isTouched=!1)),o.activeElement&&h(o.activeElement).is(n.focusableElements)&&o.activeElement!==c[0]&&o.activeElement.blur();const s=t&&e.allowTouchMove&&r.touchStartPreventDefault;!r.touchStartForcePreventDefault&&!s||c[0].isContentEditable||axPreventDefault(p)}e.params.freeMode&&e.params.freeMode.enabled&&e.freeMode&&e.animating&&!r.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",p)}function Ft(t){const e=s(),i=this,o=i.touchEventsData,{params:a,touches:n,rtlTranslate:r,enabled:l}=i;if(!l)return;let d=t;if(d.originalEvent&&(d=d.originalEvent),!o.isTouched)return void(o.startMoving&&o.isScrolling&&i.emit("touchMoveOpposite",d));if(o.isTouchEvent&&"touchmove"!==d.type)return;const p="touchmove"===d.type&&d.targetTouches&&(d.targetTouches[0]||d.changedTouches[0]),c="touchmove"===d.type?p.pageX:d.pageX,u="touchmove"===d.type?p.pageY:d.pageY;if(d.preventedByNestedSwiper)return n.startX=c,void(n.startY=u);if(!i.allowTouchMove)return h(d.target).is(o.focusableElements)||(i.allowClick=!1),void(o.isTouched&&(Object.assign(n,{startX:c,startY:u,currentX:c,currentY:u}),o.touchStartTime=G()));if(o.isTouchEvent&&a.touchReleaseOnEdges&&!a.loop)if(i.isVertical()){if(un.startY&&i.translate>=i.minTranslate())return o.isTouched=!1,void(o.isMoved=!1)}else if(cn.startX&&i.translate>=i.minTranslate())return;if(o.isTouchEvent&&e.activeElement&&d.target===e.activeElement&&h(d.target).is(o.focusableElements))return o.isMoved=!0,void(i.allowClick=!1);if(o.allowTouchCallbacks&&i.emit("touchMove",d),d.targetTouches&&d.targetTouches.length>1)return;n.currentX=c,n.currentY=u;const m=n.currentX-n.startX,g=n.currentY-n.startY;if(i.params.threshold&&Math.sqrt(m**2+g**2)=25&&(t=180*Math.atan2(Math.abs(g),Math.abs(m))/Math.PI,o.isScrolling=i.isHorizontal()?t>a.touchAngle:90-t>a.touchAngle)}if(o.isScrolling&&i.emit("touchMoveOpposite",d),void 0===o.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(o.startMoving=!0)),o.isScrolling)return void(o.isTouched=!1);if(!o.startMoving)return;i.allowClick=!1,!a.cssMode&&d.cancelable&&axPreventDefault(d),a.touchMoveStopPropagation&&!a.nested&&d.stopPropagation(),o.isMoved||(a.loop&&!a.cssMode&&i.loopFix(),o.startTranslate=i.getTranslate(),i.setTransition(0),i.animating&&i.$wrapperEl.trigger("webkitTransitionEnd transitionend"),o.allowMomentumBounce=!1,!a.grabCursor||!0!==i.allowSlideNext&&!0!==i.allowSlidePrev||i.setGrabCursor(!0),i.emit("sliderFirstMove",d)),i.emit("sliderMove",d),o.isMoved=!0;let f=i.isHorizontal()?m:g;n.diff=f,f*=a.touchRatio,r&&(f=-f),i.swipeDirection=f>0?"prev":"next",o.currentTranslate=f+o.startTranslate;let x=!0,y=a.resistanceRatio;if(a.touchReleaseOnEdges&&(y=0),f>0&&o.currentTranslate>i.minTranslate()?(x=!1,a.resistance&&(o.currentTranslate=i.minTranslate()-1+(-i.minTranslate()+o.startTranslate+f)**y)):f<0&&o.currentTranslateo.startTranslate&&(o.currentTranslate=o.startTranslate),i.allowSlidePrev||i.allowSlideNext||(o.currentTranslate=o.startTranslate),a.threshold>0){if(!(Math.abs(f)>a.threshold||o.allowThresholdMove))return void(o.currentTranslate=o.startTranslate);if(!o.allowThresholdMove)return o.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,o.currentTranslate=o.startTranslate,void(n.diff=i.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}a.followFinger&&!a.cssMode&&((a.freeMode&&a.freeMode.enabled&&i.freeMode||a.watchSlidesProgress)&&(i.updateActiveIndex(),i.updateSlidesClasses()),i.params.freeMode&&a.freeMode.enabled&&i.freeMode&&i.freeMode.onTouchMove(),i.updateProgress(o.currentTranslate),i.setTranslate(o.currentTranslate))}function jt(t){const e=this,s=e.touchEventsData,{params:i,touches:o,rtlTranslate:a,slidesGrid:n,enabled:r}=e;if(!r)return;let l=t;if(l.originalEvent&&(l=l.originalEvent),s.allowTouchCallbacks&&e.emit("touchEnd",l),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&i.grabCursor&&e.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);i.grabCursor&&s.isMoved&&s.isTouched&&(!0===e.allowSlideNext||!0===e.allowSlidePrev)&&e.setGrabCursor(!1);const h=G(),d=h-s.touchStartTime;if(e.allowClick){const t=l.path||l.composedPath&&l.composedPath();e.updateClickedSlide(t&&t[0]||l.target),e.emit("tap click",l),d<300&&h-s.lastClickTime<300&&e.emit("doubleTap doubleClick",l)}if(s.lastClickTime=G(),X(()=>{e.destroyed||(e.allowClick=!0)}),!s.isTouched||!s.isMoved||!e.swipeDirection||0===o.diff||s.currentTranslate===s.startTranslate)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let p;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,p=i.followFinger?a?e.translate:-e.translate:-s.currentTranslate,i.cssMode)return;if(e.params.freeMode&&i.freeMode.enabled)return void e.freeMode.onTouchEnd({currentPos:p});let c=0,u=e.slidesSizesGrid[0];for(let t=0;t=n[t]&&p=n[t]&&(c=t,u=n[n.length-1]-n[n.length-2])}let m=null,g=null;i.rewind&&(e.isBeginning?g=e.params.virtual&&e.params.virtual.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(m=0));const f=(p-n[c])/u,x=ci.longSwipesMs){if(!i.longSwipes)return void e.slideTo(e.activeIndex);"next"===e.swipeDirection&&(f>=i.longSwipesRatio?e.slideTo(i.rewind&&e.isEnd?m:c+x):e.slideTo(c)),"prev"===e.swipeDirection&&(f>1-i.longSwipesRatio?e.slideTo(c+x):null!==g&&f<0&&Math.abs(f)>i.longSwipesRatio?e.slideTo(g):e.slideTo(c))}else{if(!i.shortSwipes)return void e.slideTo(e.activeIndex);const t=e.navigation&&(l.target===e.navigation.nextEl||l.target===e.navigation.prevEl);t?l.target===e.navigation.nextEl?e.slideTo(c+x):e.slideTo(c):("next"===e.swipeDirection&&e.slideTo(null!==m?m:c+x),"prev"===e.swipeDirection&&e.slideTo(null!==g?g:c))}}function Yt(){const t=this,{params:e,el:s}=t;if(s&&0===s.offsetWidth)return;e.breakpoints&&t.setBreakpoint();const{allowSlideNext:i,allowSlidePrev:o,snapGrid:a}=t;t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses(),("auto"===e.slidesPerView||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides?t.slideTo(t.slides.length-1,0,!1,!0):t.slideTo(t.activeIndex,0,!1,!0),t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.run(),t.allowSlidePrev=o,t.allowSlideNext=i,t.params.watchOverflow&&a!==t.snapGrid&&t.checkOverflow()}function Ut(t){const e=this;e.enabled&&(e.allowClick||(e.params.preventClicks&&axPreventDefault(t),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation())))}function Wt(){const t=this,{wrapperEl:e,rtlTranslate:s,enabled:i}=t;if(!i)return;let o;t.previousTranslate=t.translate,t.isHorizontal()?t.translate=-e.scrollLeft:t.translate=-e.scrollTop,0===t.translate&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();const a=t.maxTranslate()-t.minTranslate();o=0===a?0:(t.translate-t.minTranslate())/a,o!==t.progress&&t.updateProgress(s?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}function Xt(){}function Gt(){const t=this,e=s(),{params:i,support:o}=t;t.onTouchStart=Vt.bind(t),t.onTouchMove=Ft.bind(t),t.onTouchEnd=jt.bind(t),i.cssMode&&(t.onScroll=Wt.bind(t)),t.onClick=Ut.bind(t),o.touch&&!ts&&(e.addEventListener("touchstart",Xt),ts=!0),es(t,"on")}function _t(){const t=this;es(t,"off")}function Jt(){const t=this,{activeIndex:e,initialized:s,loopedSlides:i=0,params:o,$el:a}=t,n=o.breakpoints;if(!n||n&&0===Object.keys(n).length)return;const r=t.getBreakpoint(n,t.params.breakpointsBase,t.el);if(!r||t.currentBreakpoint===r)return;const l=r in n?n[r]:void 0,h=l||t.originalParams,d=is(t,o),p=is(t,h),c=o.enabled;d&&!p?(a.removeClass(`${o.containerModifierClass}grids ${o.containerModifierClass}grid-column`),t.emitContainerClasses()):!d&&p&&(a.addClass(`${o.containerModifierClass}grids`),(h.grid.fill&&"column"===h.grid.fill||!h.grid.fill&&"column"===o.grid.fill)&&a.addClass(`${o.containerModifierClass}grid-column`),t.emitContainerClasses());const u=h.direction&&h.direction!==o.direction,m=o.loop&&(h.slidesPerView!==o.slidesPerView||u);u&&s&&t.changeDirection(),Q(t.params,h);const g=t.params.enabled;Object.assign(t,{ diff --git a/版本记录/readme.md b/版本记录/readme.md index f653175..30883ad 100644 --- a/版本记录/readme.md +++ b/版本记录/readme.md @@ -15,4 +15,5 @@ 使用Promise封装XMLHttpRequest做异步请求 修改日志文件生成及读取位置 上传文件格式新增支持js、css、html、vsdx、dmp、7z、ppt、pptx + AxUI的axAjax方法,timeout默认值改为6000000 ``` \ No newline at end of file