"use strict";function makeMap(e,t){const n=Object.create(null),a=e.split(",");for(let e=0;en[e.toLowerCase()]:e=>n[e]}const no=()=>!1,isNonPhrasingTag=makeMap("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),attribute=/^\s*([^\s"'<>/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ncname="[a-zA-Z_][\\w\\-\\.]*",qnameCapture=`((?:${ncname}\\:)?${ncname})`,startTagOpen=new RegExp(`^<${qnameCapture}`),startTagClose=/^\s*(\/?)>/,endTag=new RegExp(`^<\\/${qnameCapture}[^>]*>`),doctype=/^]+>/i,comment=/^/g,"$1").replace(//g,"$1")),shouldIgnoreFirstNewline(a,r)&&(r=r.slice(1)),t.chars&&t.chars(r),""));i+=e.length-o.length,e=o,h(a,i-n,i)}else{let n,a,r,o=e.indexOf("<");if(0===o){if(comment.test(e)){const n=e.indexOf("--\x3e");if(n>=0){t.shouldKeepComment&&t.comment(e.substring(4,n)),l(n+3);continue}}if(conditionalComment.test(e)){const t=e.indexOf("]>");if(t>=0){l(t+2);continue}}const n=e.match(doctype);if(n){l(n[0].length);continue}const a=e.match(endTag);if(a){const e=i;l(a[0].length),h(a[1],e,i);continue}const r=d();if(r){g(r),shouldIgnoreFirstNewline(c,e)&&l(1);continue}}if(o>=0){for(a=e.slice(o);!(endTag.test(a)||startTagOpen.test(a)||comment.test(a)||conditionalComment.test(a)||(r=a.indexOf("<",1))<0);)o+=r,a=e.slice(o);n=e.substring(0,o),l(o)}o<0&&(n=e,e=""),t.chars&&n&&t.chars(n)}if(e===s){t.chars&&t.chars(e),"production"!==process.env.NODE_ENV&&!n.length&&t.warn&&t.warn(`Mal-formatted tag at end of template: "${e}"`);break}}function l(t){i+=t,e=e.substring(t)}function d(){const t=e.match(startTagOpen);if(t){const n={tagName:t[1],attrs:[],start:i};let a,r;for(l(t[0].length);!(a=e.match(startTagClose))&&(r=e.match(attribute));)l(r[0].length),n.attrs.push(r);if(a)return n.unarySlash=a[1],l(a[0].length),n.end=i,n}}function g(e){const s=e.tagName,i=e.unarySlash;a&&("p"===c&&isNonPhrasingTag(s)&&h(c),o(s)&&c===s&&h(s));const l=r(s)||!!i,d=e.attrs.length,g=new Array(d);for(let n=0;n=0&&n[o].lowerCasedTag!==s;o--);else o=0;if(o>=0){for(let s=n.length-1;s>=o;s--)"production"!==process.env.NODE_ENV&&(s>o||!e)&&t.warn&&t.warn(`tag <${n[s].tag}> has no matching end tag.`),t.end&&t.end(n[s].tag,a,r);n.length=o,c=o&&n[o-1].tag}else"br"===s?t.start&&t.start(e,[],!0,a,r):"p"===s&&(t.start&&t.start(e,[],!1,a,r),t.end&&t.end(e,a,r))}h()}function parse(e){const t={tag:"root",attrs:[],unary:!1,start:0,contentStart:0,contentEnd:e.length,end:e.length,children:[],comments:[]},n=[t];let a=t;return parseHTML(e,{start:function(e,t,r,o,s){const c={tag:e,attrs:t,unary:r,start:o,children:[]};a.children.push(c),r?c.end=s:(c.contentStart=s,n.push(c),a=c)},end:function(e,t,r){n.pop(),a.contentEnd=t,a.end=r,a=n[n.length-1]}}),t}var parserVue=parse;module.exports=parserVue;