Liferay.Loader.define("portal-search-web$codemirror@5.62.0/addon/hint/xml-hint",["module","exports","require","../../lib/codemirror"],(function(t,r,e){window,function(t){"use strict";var r=t.Pos;function e(t,r,e){return e?t.indexOf(r)>=0:0==t.lastIndexOf(r,0)}t.registerHelper("hint","xml",(function(n,i){var s=i&&i.schemaInfo,a=i&&i.quoteChar||'"',o=i&&i.matchInMiddle;if(s){var l=n.getCursor(),h=n.getTokenAt(l);if(h.end>l.ch&&(h.end=l.ch,h.string=h.string.slice(0,l.ch-h.start)),(x=t.innerMode(n.getMode(),h.state)).mode.xmlCurrentTag){var c,g,f=[],u=!1,d=/\btag\b/.test(h.type)&&!/>$/.test(h.string),p=d&&/^\w/.test(h.string);if(p){var m=n.getLine(l.line).slice(Math.max(0,h.start-2),h.start),v=/<\/$/.test(m)?"close":/<$/.test(m)?"open":null;v&&(g=h.start-("close"==v?2:1))}else d&&"<"==h.string?v="open":d&&"</"==h.string&&(v="close");var y=x.mode.xmlCurrentTag(x.state);if(!d&&!y||v){p&&(c=h.string),u=v;var x,b=x.mode.xmlCurrentContext?x.mode.xmlCurrentContext(x.state):[],w=(x=b.length&&b[b.length-1])&&s[x],C=x?w&&w.children:s["!top"];if(C&&"close"!=v)for(var O=0;O<C.length;++O)c&&!e(C[O],c,o)||f.push("<"+C[O]);else if("close"!=v)for(var A in s)!s.hasOwnProperty(A)||"!top"==A||"!attrs"==A||c&&!e(A,c,o)||f.push("<"+A);x&&(!c||"close"==v&&e(x,c,o))&&f.push("</"+x+">")}else{var M=(w=y&&s[y.name])&&w.attrs,P=s["!attrs"];if(!M&&!P)return;if(M){if(P){var $={};for(var L in P)P.hasOwnProperty(L)&&($[L]=P[L]);for(var L in M)M.hasOwnProperty(L)&&($[L]=M[L]);M=$}}else M=P;if("string"==h.type||"="==h.string){var I,T=(m=n.getRange(r(l.line,Math.max(0,l.ch-60)),r(l.line,"string"==h.type?h.start:h.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!T||!M.hasOwnProperty(T[1])||!(I=M[T[1]]))return;if("function"==typeof I&&(I=I.call(this,n)),"string"==h.type){c=h.string;var j=0;/['"]/.test(h.string.charAt(0))&&(a=h.string.charAt(0),c=h.string.slice(1),j++);var q=h.string.length;if(/['"]/.test(h.string.charAt(q-1))&&(a=h.string.charAt(q-1),c=h.string.substr(j,q-2)),j){var k=n.getLine(l.line);k.length>h.end&&k.charAt(h.end)==a&&h.end++}u=!0}var H=function(t){if(t)for(var r=0;r<t.length;++r)c&&!e(t[r],c,o)||f.push(a+t[r]+a);return z()};return I&&I.then?I.then(H):H(I)}for(var R in"attribute"==h.type&&(c=h.string,u=!0),M)!M.hasOwnProperty(R)||c&&!e(R,c,o)||f.push(R)}return z()}}function z(){return{list:f,from:u?r(l.line,null==g?h.start:g):l,to:u?r(l.line,h.end):l}}}))}("object"==typeof r&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=xml-hint.js.map