File: /home/wbwebdes/domains/support.wb-webdesign.com/private_html/js/jquery.csv.min.js
RegExp.escape=function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")},(function(){"use strict";let e;(e="undefined"!=typeof jQuery&&jQuery?jQuery:{}).csv={defaults:{separator:",",delimiter:'"',headers:!0},hooks:{castToScalar:function(e,r){if(isNaN(e))return e;if(/\./.test(e))return parseFloat(e);{let t=parseInt(e);return isNaN(t)?null:t}}},parsers:{parse:function(e,r){let t=r.separator,a=r.delimiter;r.state.rowNum||(r.state.rowNum=1),r.state.colNum||(r.state.colNum=1);let o=[],s=[],n=0,i="",l=!1;function u(){if(n=0,i="",r.start&&r.state.rowNum<r.start){s=[],r.state.rowNum++,r.state.colNum=1;return}if(void 0===r.onParseEntry)o.push(s);else{let e=r.onParseEntry(s,r.state);!1!==e&&o.push(e)}s=[],r.end&&r.state.rowNum>=r.end&&(l=!0),r.state.rowNum++,r.state.colNum=1}function c(){if(void 0===r.onParseValue)s.push(i);else if(r.headers&&1===r.state.rowNum)s.push(i);else{let e=r.onParseValue(i,r.state);!1!==e&&s.push(e)}i="",n=0,r.state.colNum++}let f=RegExp.escape(t),d=RegExp.escape(a),m=/(D|S|\r\n|\n|\r|[^DS\r\n]+)/,p=m.source;return m=RegExp(p=(p=p.replace(/S/g,f)).replace(/D/g,d),"gm"),e.replace(m,function(e){if(!l)switch(n){case 0:if(e===t){i+="",c();break}if(e===a){n=1;break}if(/^(\r\n|\n|\r)$/.test(e)){c(),u();break}i+=e,n=3;break;case 1:if(e===a){n=2;break}i+=e,n=1;break;case 2:if(e===a){i+=e,n=1;break}if(e===t){c();break}if(/^(\r\n|\n|\r)$/.test(e)){c(),u();break}throw Error("CSVDataError: Illegal State [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");case 3:if(e===t){c();break}if(/^(\r\n|\n|\r)$/.test(e)){c(),u();break}if(e===a)throw Error("CSVDataError: Illegal Quote [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");throw Error("CSVDataError: Illegal Data [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");default:throw Error("CSVDataError: Unknown State [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]")}}),0!==s.length&&(c(),u()),o},splitLines:function(r,t){if(!r)return;t=t||{};let a=t.separator||e.csv.defaults.separator,o=t.delimiter||e.csv.defaults.delimiter;t.state=t.state||{},t.state.rowNum||(t.state.rowNum=1);let s=[],n=0,i="",l=!1;function u(){if(n=0,t.start&&t.state.rowNum<t.start){i="",t.state.rowNum++;return}if(void 0===t.onParseEntry)s.push(i);else{let e=t.onParseEntry(i,t.state);!1!==e&&s.push(e)}i="",t.end&&t.state.rowNum>=t.end&&(l=!0),t.state.rowNum++}let c=RegExp.escape(a),f=RegExp.escape(o),d=/(D|S|\n|\r|[^DS\r\n]+)/,m=d.source;return d=RegExp(m=(m=m.replace(/S/g,c)).replace(/D/g,f),"gm"),r.replace(d,function(e){if(!l)switch(n){case 0:if(e===a){i+=e,n=0;break}if(e===o){i+=e,n=1;break}if("\n"===e){u();break}if(/^\r$/.test(e))break;i+=e,n=3;break;case 1:if(e===o){i+=e,n=2;break}i+=e,n=1;break;case 2:{let r=i.substr(i.length-1);if(e===o&&r===o){i+=e,n=1;break}if(e===a){i+=e,n=0;break}if("\n"===e){u();break}if("\r"===e)break;throw Error("CSVDataError: Illegal state [Row:"+t.state.rowNum+"]")}case 3:if(e===a){i+=e,n=0;break}if("\n"===e){u();break}if("\r"===e)break;if(e===o)throw Error("CSVDataError: Illegal quote [Row:"+t.state.rowNum+"]");throw Error("CSVDataError: Illegal state [Row:"+t.state.rowNum+"]");default:throw Error("CSVDataError: Unknown state [Row:"+t.state.rowNum+"]")}}),""!==i&&u(),s},parseEntry:function(e,r){let t=r.separator,a=r.delimiter;r.state.rowNum||(r.state.rowNum=1),r.state.colNum||(r.state.colNum=1);let o=[],s=0,n="";function i(){if(void 0===r.onParseValue)o.push(n);else{let e=r.onParseValue(n,r.state);!1!==e&&o.push(e)}n="",s=0,r.state.colNum++}if(!r.match){let l=RegExp.escape(t),u=RegExp.escape(a),c=/(D|S|\n|\r|[^DS\r\n]+)/.source;c=(c=c.replace(/S/g,l)).replace(/D/g,u),r.match=RegExp(c,"gm")}return e.replace(r.match,function(e){switch(s){case 0:if(e===t){n+="",i();break}if(e===a){s=1;break}if("\n"===e||"\r"===e)break;n+=e,s=3;break;case 1:if(e===a){s=2;break}n+=e,s=1;break;case 2:if(e===a){n+=e,s=1;break}if(e===t){i();break}if("\n"===e||"\r"===e)break;throw Error("CSVDataError: Illegal State [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");case 3:if(e===t){i();break}if("\n"===e||"\r"===e)break;if(e===a)throw Error("CSVDataError: Illegal Quote [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");throw Error("CSVDataError: Illegal Data [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]");default:throw Error("CSVDataError: Unknown State [Row:"+r.state.rowNum+"][Col:"+r.state.colNum+"]")}}),i(),o}},helpers:{collectPropertyNames:function(e){let r=[],t=[],a=[];for(r in e)for(t in e[r])e[r].hasOwnProperty(t)&&0>a.indexOf(t)&&"function"!=typeof e[r][t]&&a.push(t);return a}},toArray:function(r,t,a){if(void 0!==t&&"function"==typeof t){if(void 0!==a)return console.error("You cannot 3 arguments with the 2nd argument being a function");a=t,t={}}t=void 0!==t?t:{};let o={};o.callback=void 0!==a&&"function"==typeof a&&a,o.separator="separator"in t?t.separator:e.csv.defaults.separator,o.delimiter="delimiter"in t?t.delimiter:e.csv.defaults.delimiter;let s=void 0!==t.state?t.state:{};t={delimiter:o.delimiter,separator:o.separator,onParseEntry:t.onParseEntry,onParseValue:t.onParseValue,state:s};let n=e.csv.parsers.parseEntry(r,t);if(!o.callback)return n;o.callback("",n)},toArrays:function(r,t,a){if(void 0!==t&&"function"==typeof t){if(void 0!==a)return console.error("You cannot 3 arguments with the 2nd argument being a function");a=t,t={}}t=void 0!==t?t:{};let o={};o.callback=void 0!==a&&"function"==typeof a&&a,o.separator="separator"in t?t.separator:e.csv.defaults.separator,o.delimiter="delimiter"in t?t.delimiter:e.csv.defaults.delimiter;let s=[];if(void 0!==(t={delimiter:o.delimiter,separator:o.separator,onPreParse:t.onPreParse,onParseEntry:t.onParseEntry,onParseValue:t.onParseValue,onPostParse:t.onPostParse,start:t.start,end:t.end,state:{rowNum:1,colNum:1}}).onPreParse&&(r=t.onPreParse(r,t.state)),s=e.csv.parsers.parse(r,t),void 0!==t.onPostParse&&(s=t.onPostParse(s,t.state)),!o.callback)return s;o.callback("",s)},toObjects:function(r,t,a){if(void 0!==t&&"function"==typeof t){if(void 0!==a)return console.error("You cannot 3 arguments with the 2nd argument being a function");a=t,t={}}t=void 0!==t?t:{};let o={};o.callback=void 0!==a&&"function"==typeof a&&a,o.separator="separator"in t?t.separator:e.csv.defaults.separator,o.delimiter="delimiter"in t?t.delimiter:e.csv.defaults.delimiter,o.headers="headers"in t?t.headers:e.csv.defaults.headers,t.start="start"in t?t.start:1,o.headers&&t.start++,t.end&&o.headers&&t.end++;let s=[],n=[];t={delimiter:o.delimiter,separator:o.separator,onPreParse:t.onPreParse,onParseEntry:t.onParseEntry,onParseValue:t.onParseValue,onPostParse:t.onPostParse,start:t.start,end:t.end,state:{rowNum:1,colNum:1},match:!1,transform:t.transform};let i={delimiter:o.delimiter,separator:o.separator,start:1,end:1,state:{rowNum:1,colNum:1},headers:!0};void 0!==t.onPreParse&&(r=t.onPreParse(r,t.state));let l=e.csv.parsers.splitLines(r,i),u=e.csv.toArray(l[0],i);s=e.csv.parsers.splitLines(r,t),t.state.colNum=1,u?t.state.rowNum=2:t.state.rowNum=1;for(let c=0,f=s.length;c<f;c++){let d=e.csv.toArray(s[c],t),m={};for(let p=0;p<u.length;p++)m[u[p]]=d[p];void 0!==t.transform?n.push(t.transform.call(void 0,m)):n.push(m),t.state.rowNum++}if(void 0!==t.onPostParse&&(n=t.onPostParse(n,t.state)),!o.callback)return n;o.callback("",n)},fromArrays:function(r,t,a){if(void 0!==t&&"function"==typeof t){if(void 0!==a)return console.error("You cannot 3 arguments with the 2nd argument being a function");a=t,t={}}t=void 0!==t?t:{};let o={};o.callback=void 0!==a&&"function"==typeof a&&a,o.separator="separator"in t?t.separator:e.csv.defaults.separator,o.delimiter="delimiter"in t?t.delimiter:e.csv.defaults.delimiter;let s="";for(let n=0;n<r.length;n++){let i=r[n],l=[];for(let u=0;u<i.length;u++){let c=void 0===i[u]||null===i[u]?"":i[u].toString();c.indexOf(o.delimiter)>-1&&(c=c.replace(RegExp(o.delimiter,"g"),o.delimiter+o.delimiter));let f="\n|\r|S|D";f=(f=f.replace("S",o.separator)).replace("D",o.delimiter),c.search(f)>-1&&(c=o.delimiter+c+o.delimiter),l.push(c)}s+=l.join(o.separator)+"\n"}if(!o.callback)return s;o.callback("",s)},fromObjects:function(r,t,a){if(void 0!==t&&"function"==typeof t){if(void 0!==a)return console.error("You cannot 3 arguments with the 2nd argument being a function");a=t,t={}}t=void 0!==t?t:{};let o={};if(o.callback=void 0!==a&&"function"==typeof a&&a,o.separator="separator"in t?t.separator:e.csv.defaults.separator,o.delimiter="delimiter"in t?t.delimiter:e.csv.defaults.delimiter,o.headers="headers"in t?t.headers:e.csv.defaults.headers,o.sortOrder="sortOrder"in t?t.sortOrder:"declare",o.manualOrder="manualOrder"in t?t.manualOrder:[],o.transform=t.transform,"string"==typeof o.manualOrder&&(o.manualOrder=e.csv.toArray(o.manualOrder,o)),void 0!==o.transform){let s=r;r=[];for(let n=0;n<s.length;n++)r.push(o.transform.call(void 0,s[n]))}let i=e.csv.helpers.collectPropertyNames(r);if("alpha"===o.sortOrder&&i.sort(),o.manualOrder.length>0){let l=[].concat(o.manualOrder);for(let u=0;u<i.length;u++)0>l.indexOf(i[u])&&l.push(i[u]);i=l}let c,f=[],d;o.headers&&f.push(i);for(let m=0;m<r.length;m++){c=[];for(let p=0;p<i.length;p++)(d=i[p])in r[m]&&"function"!=typeof r[m][d]?c.push(r[m][d]):c.push("");f.push(c)}return e.csv.fromArrays(f,t,o.callback)}},e.csvEntry2Array=e.csv.toArray,e.csv2Array=e.csv.toArrays,e.csv2Dictionary=e.csv.toObjects,"undefined"!=typeof module&&module.exports&&(module.exports=e.csv)}).call(this);