filesbox/web/dist/design/designstatic/lib/artTemplate/template-web.js

10 lines
17 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
/*! art-template@4.13.2 for browser | https://github.com/aui/art-template */(function(f,p){typeof exports=="object"&&typeof module=="object"?module.exports=p():typeof define=="function"&&define.amd?define([],p):typeof exports=="object"?exports.template=p():f.template=p()})(typeof self!="undefined"?self:this,function(){return function(f){function p(e){if(i[e])return i[e].exports;var a=i[e]={i:e,l:!1,exports:{}};return f[e].call(a.exports,a,a.exports,p),a.l=!0,a.exports}var i={};return p.m=f,p.c=i,p.d=function(e,a,l){p.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:l})},p.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(a,"a",a),a},p.o=function(e,a){return Object.prototype.hasOwnProperty.call(e,a)},p.p="",p(p.s=4)}([function(f,p,i){"use strict";var e=i(6),a=i(2),l=i(22),s=function(r,t){t.onerror(r,t);var n=function(){return"{Template Error}"};return n.mappings=[],n.sourcesContent=[],n},o=function r(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof t!="string"?n=t:n.source=t,n=a.$extend(n),t=n.source,n.debug===!0&&(n.cache=!1,n.minimize=!1,n.compileDebug=!0),n.compileDebug&&(n.minimize=!1),n.filename&&(n.filename=n.resolveFilename(n.filename,n));var c=n.filename,w=n.cache,m=n.caches;if(w&&c){var x=m.get(c);if(x)return x}if(!t)try{t=n.loader(c,n),n.source=t}catch(h){var d=new l({name:"CompileError",path:c,message:"template not found: "+h.message,stack:h.stack});if(n.bail)throw d;return s(d,n)}var b=void 0,k=new e(n);try{b=k.build()}catch(h){if(h=new l(h),n.bail)throw h;return s(h,n)}var T=function(h,E){try{return b(h,E)}catch(j){if(!n.compileDebug)return n.cache=!1,n.compileDebug=!0,r(n)(h,E);if(j=new l(j),n.bail)throw j;return s(j,n)()}};return T.mappings=b.mappings,T.sourcesContent=b.sourcesContent,T.toString=function(){return b.toString()},w&&c&&m.set(c,T),T};o.Compiler=e,f.exports=o},function(f,p){Object.defineProperty(p,"__esModule",{value:!0}),p.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,p.matchToToken=function(i){var e={type:"invalid",value:i[0]};return i[1]?(e.type="string",e.closed=!(!i[3]&&!i[4])):i[5]?e.type="comment":i[6]?(e.type="comment",e.closed=!!i[7]):i[8]?e.type="regex":i[9]?e.type="number":i[10]?e.type="name":i[11]?e.type="punctuator":i[12]&&(e.type="whitespace"),e}},function(f,p,i){"use strict";function e(){this.$extend=function(b){return b=b||{},l(b,b instanceof e?b:this)}}var a=i(10),l=i(12),s=i(13),o=i(14),r=i(15),t=i(16),n=i(17),c=i(18),w=i(19),m=i(21),x=typeof window=="undefined",d={source:null,filename:null,rules:[c,n],escape:!0,debug:!!x&&process.env.NODE_ENV!=="production",bail:!0,cache:!0,minimize:!0,compileDebug:!1,resolveFilename:m,include:s,htmlMinifier:w,htmlMinifierOptions:{collapseWhitespace:!0,minifyCSS:!0,minifyJS:!0,ignoreCustomFragments:[]},onerror:o,loader:t,caches:r,root:"/",extname:".art",ignore:[],imports:a};e.prototype=d,f.exports=new e},function(f,p){},function(f,p,i){"use strict";var e=i(5),a=i(0),l=i(23),s=function(o,r){return r instanceof Object?e({filename:o},r):a({filename:o,source:r})};s.render=e,s.compile=a,s.defaults=l,f.exports=s},function(f,p,i){"use strict";var e=i(0),a=function(l,s,o){return e(l,o)(s)};f.exports=a},function(f,p,i){"use strict";function e(O,u,g){return u in O?Object.defineProperty(O,u,{value:g,enumerable:!0,configurable:!0,writable:!0}):O[u]=g,O}function a(O){if(Array.isArray(O)){for(var u=0,g=Array(O.length);u<O.length;u++)g[u]=O[u];return g}return Array.from(O)}function l(O,u){if(!(O instan
`);try{var R=new Function(n,E,"return "+J)(C,u);return R.mappings=S,R.sourcesContent=[_],R}catch($){for(var D=0,Y=0,L=0,z=void 0;D<v.length;){var I=v[D];if(!this.checkExpression(I.code)){Y=I.tplToken.line,L=I.tplToken.start,z=I.code;break}D++}throw{name:"CompileError",path:A,message:$.message,line:Y+1,column:L+1,source:_,generated:z,stack:$.stack}}}}]),O}();W.CONSTS={DATA:t,IMPORTS:n,PRINT:c,INCLUDE:w,EXTEND:m,BLOCK:x,OPTIONS:E,OUT:d,LINE:b,BLOCKS:k,SLICE:T,FROM:h,ESCAPE:"$escape",EACH:"$each"},f.exports=W},function(f,p,i){"use strict";var e=i(8),a=i(1).default,l=i(1).matchToToken,s=function(o){return o.match(a).map(function(r){return a.lastIndex=0,l(a.exec(r))}).map(function(r){return r.type==="name"&&e(r.value)&&(r.type="keyword"),r})};f.exports=s},function(f,p,i){"use strict";var e={abstract:!0,await:!0,boolean:!0,break:!0,byte:!0,case:!0,catch:!0,char:!0,class:!0,const:!0,continue:!0,debugger:!0,default:!0,delete:!0,do:!0,double:!0,else:!0,enum:!0,export:!0,extends:!0,false:!0,final:!0,finally:!0,float:!0,for:!0,function:!0,goto:!0,if:!0,implements:!0,import:!0,in:!0,instanceof:!0,int:!0,interface:!0,let:!0,long:!0,native:!0,new:!0,null:!0,package:!0,private:!0,protected:!0,public:!0,return:!0,short:!0,static:!0,super:!0,switch:!0,synchronized:!0,this:!0,throw:!0,transient:!0,true:!0,try:!0,typeof:!0,var:!0,void:!0,volatile:!0,while:!0,with:!0,yield:!0};f.exports=function(a){return e.hasOwnProperty(a)}},function(f,p,i){"use strict";function e(s){var o=new String(s.value);return o.line=s.line,o.start=s.start,o.end=s.end,o}function a(s,o,r){this.type=s,this.value=o,this.script=null,r?(this.line=r.line+r.value.split(/\n/).length-1,this.line===r.line?this.start=r.end:this.start=r.value.length-r.value.lastIndexOf(`
`)-1):(this.line=0,this.start=0),this.end=this.start+this.value.length}var l=function(s,o){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},t=[new a("string",s)],n=0;n<o.length;n++)for(var c=o[n],w=c.test.ignoreCase?"ig":"g",m=new RegExp(c.test.source,w),x=0;x<t.length;x++){var d=t[x],b=t[x-1];if(d.type==="string"){for(var k=void 0,T=0,h=[],E=d.value;(k=m.exec(E))!==null;)k.index>T&&(b=new a("string",E.slice(T,k.index),b),h.push(b)),b=new a("expression",k[0],b),k[0]=e(b),b.script=c.use.apply(r,k),h.push(b),T=k.index+k[0].length;T<E.length&&(b=new a("string",E.slice(T),b),h.push(b)),t.splice.apply(t,[x,1].concat(h)),x+=h.length-1}}return t};l.TYPE_STRING="string",l.TYPE_EXPRESSION="expression",l.TYPE_RAW="raw",l.TYPE_ESCAPE="escape",f.exports=l},function(f,p,i){"use strict";(function(e){function a(t){return typeof t!="string"&&(t=t==null?"":typeof t=="function"?a(t.call(t)):JSON.stringify(t)),t}function l(t){var n=""+t,c=r.exec(n);if(!c)return t;var w="",m=void 0,x=void 0,d=void 0;for(m=c.index,x=0;m<n.length;m++){switch(n.charCodeAt(m)){case 34:d="&#34;";break;case 38:d="&#38;";break;case 39:d="&#39;";break;case 60:d="&#60;";break;case 62:d="&#62;";break;default:continue}x!==m&&(w+=n.substring(x,m)),x=m+1,w+=d}return x!==m?w+n.substring(x,m):w}/*! art-template@runtime | https://github.com/aui/art-template */var s=typeof self!="undefined"?self:typeof window!="undefined"?window:e!==void 0?e:{},o=Object.create(s),r=/["&'<>]/;o.$escape=function(t){return l(a(t))},o.$each=function(t,n){if(Array.isArray(t))for(var c=0,w=t.length;c<w;c++)n(t[c],c);else for(var m in t)n(t[m],m)},f.exports=o}).call(p,i(11))},function(f,p){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){typeof window=="object"&&(i=window)}f.exports=i},function(f,p,i){"use strict";var e=Object.prototype.toString,a=function(s){return s===null?"Null":e.call(s).slice(8,-1)},l=function s(o,r){var t=void 0,n=a(o);if(n==="Object"?t=Object.create(r||{}):n==="Array"&&(t=[].concat(r||[])),t){for(var c in o)Object.hasOwnProperty.call(o,c)&&(t[c]=s(o[c],t[c]));return t}return o};f.exports=l},function(f,p,i){"use strict";var e=function(a,l,s,o){var r=i(0);return o=o.$extend({filename:o.resolveFilename(a,o),bail:!0,source:null}),r(o)(l,s)};f.exports=e},function(f,p,i){"use strict";var e=function(a){console.error(a.name,a.message)};f.exports=e},function(f,p,i){"use strict";var e={__data:Object.create(null),set:function(a,l){this.__data[a]=l},get:function(a){return this.__data[a]},reset:function(){this.__data={}}};f.exports=e},function(f,p,i){"use strict";var e=typeof window=="undefined",a=function(l){if(e)return i(3).readFileSync(l,"utf8");var s=document.getElementById(l);return s.value||s.innerHTML};f.exports=a},function(f,p,i){"use strict";var e={test:/{{([@#]?)[ \t]*(\/?)([\w\W]*?)[ \t]*}}/,use:function(a,l,s,o){var r=this,t=r.options,n=r.getEsTokens(o),c=n.map(function(h){return h.value}),w={},m=void 0,x=!!l&&"raw",d=s+c.shift(),b=function(h,E){console.warn((t.filename||"anonymous")+":"+(a.line+1)+":"+(a.start+1)+`
Template upgrade: {{`+h+"}} -> {{"+E+"}}")};switch(l==="#"&&b("#value","@value"),d){case"set":o="var "+c.join("").trim();break;case"if":o="if("+c.join("").trim()+"){";break;case"else":var k=c.indexOf("if");~k?(c.splice(0,k+1),o="}else if("+c.join("").trim()+"){"):o="}else{";break;case"/if":o="}";break;case"each":m=e._split(n),m.shift(),m[1]==="as"&&(b("each object as value index","each object value index"),m.splice(1,1)),o="$each("+(m[0]||"$data")+",function("+(m[1]||"$value")+","+(m[2]||"$index")+"){";break;case"/each":o="})";break;case"block":m=e._split(n),m.shift(),o="block("+m.join(",").trim()+",function(){";break;case"/block":o="})";break;case"echo":d="print",b("echo value","value");case"print":case"include":case"extend":if(c.join("").trim().indexOf("(")!==0){m=e._split(n),m.shift(),o=d+"("+m.join(",")+")";break}default:if(~c.indexOf("|")){var T=n.reduce(function(h,E){var j=E.value,P=E.type;return j==="|"?h.push([]):P!=="whitespace"&&P!=="comment"&&(h.length||h.push([]),j===":"&&h[h.length-1].length===1?b("value | filter: argv","value | filter argv"):h[h.length-1].push(E)),h},[]).map(function(h){return e._split(h)});o=T.reduce(function(h,E){var j=E.shift();return E.unshift(h),"$imports."+j+"("+E.join(",")+")"},T.shift().join(" ").trim())}x=x||"escape"}return w.code=o,w.output=x,w},_split:function(a){a=a.filter(function(n){var c=n.type;return c!=="whitespace"&&c!=="comment"});for(var l=0,s=a.shift(),o=/\]|\)/,r=[[s]];l<a.length;){var t=a[l];t.type==="punctuator"||s.type==="punctuator"&&!o.test(s.value)?r[r.length-1].push(t):r.push([t]),s=t,l++}return r.map(function(n){return n.map(function(c){return c.value}).join("")})}};f.exports=e},function(f,p,i){"use strict";var e={test:/<%(#?)((?:==|=#|[=-])?)[ \t]*([\w\W]*?)[ \t]*(-?)%>/,use:function(a,l,s,o){return s={"-":"raw","=":"escape","":!1,"==":"raw","=#":"raw"}[s],l&&(o="/*"+o+"*/",s=!1),{code:o,output:s}}};f.exports=e},function(f,p,i){"use strict";function e(s){if(Array.isArray(s)){for(var o=0,r=Array(s.length);o<s.length;o++)r[o]=s[o];return r}return Array.from(s)}var a=typeof window=="undefined",l=function(s,o){if(a){var r,t=i(20).minify,n=o.htmlMinifierOptions,c=o.rules.map(function(w){return w.test});(r=n.ignoreCustomFragments).push.apply(r,e(c)),s=t(s,n)}return s};f.exports=l},function(f,p){(function(i){i.noop=function(){}})(typeof f=="object"&&typeof f.exports=="object"?f.exports:window)},function(f,p,i){"use strict";var e=typeof window=="undefined",a=/^\.+\//,l=function(s,o){if(e){var r=i(3),t=o.root,n=o.extname;if(a.test(s)){var c=o.filename,w=!c||s===c,m=w?t:r.dirname(c);s=r.resolve(m,s)}else s=r.resolve(t,s);r.extname(s)||(s+=n)}return s};f.exports=l},function(f,p,i){"use strict";function e(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function a(r,t){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||typeof t!="object"&&typeof t!="function"?r:t}function l(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t)}function s(r){var t=r.name,n=r.source,c=r.path,w=r.line,m=r.column,x=r.generated,d=r.message;if(!n)return d;var b=n.split(/\n/),k=Math.max(w-3,0),T=Math.min(b.length,w+3),h=b.slice(k,T).map(function(E,j){var P=j+k+1;return(P===w?" >> ":" ")+P+"| "+E}).join(`
`);return(c||"anonymous")+":"+w+":"+m+`
`+h+`
`+t+": "+d+(x?`
generated: `+x:"")}var o=function(r){function t(n){e(this,t);var c=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,n.message));return c.name="TemplateError",c.message=s(n),Error.captureStackTrace&&Error.captureStackTrace(c,c.constructor),c}return l(t,r),t}(Error);f.exports=o},function(f,p,i){"use strict";f.exports=i(2)}])});