/** * 由 Fantastic-admin 提供技术支持 * Powered by Fantastic-admin * https://fantastic-admin.github.io */ import{p as O,q as $,r as a,b as e,L as i,u as r,h as n,a as t,s as Q,i as c,f as o,t as l,j as s,d as m}from"./style-ClrjWzkr.js";import"./index-BERX8Mlm.js";const P=new m((O=>{let $=O.pos;for(;;){let{next:a}=O;if(a<0)break;if(123==a){let a=O.peek(1);if(123==a){if(O.pos>$)break;return void O.acceptToken(1,2)}if(37==a){if(O.pos>$)break;let a=2,e=2;for(;;){let $=O.peek(a);if(32==$||10==$)++a;else if(35==$)for(++a;;){let $=O.peek(a);if($<0||10==$)break;a++}else{if(45!=$||2!=e){let i=101==$&&110==O.peek(a+1)&&100==O.peek(a+2);return void O.acceptToken(i?3:2,e)}e=++a}}}}if(O.advance(),10==a)break}O.pos>$&&O.acceptToken(180)}));function p(O,$,a){return new m((e=>{let i=e.pos;for(;;){let{next:$}=e;if(123==$&&37==e.peek(1)){let $=2;for(;;$++){let O=e.peek($);if(32!=O&&10!=O)break}let n="";for(;;$++){let O=e.peek($);if(!((r=O)>=65&&r<=90||r>=97&&r<=122))break;n+=String.fromCharCode(O)}if(n==O){if(e.pos>i)break;e.acceptToken(a,2);break}}else if($<0)break;if(e.advance(),10==$)break}var r;e.pos>i&&e.acceptToken($)}))}const q=p("endcomment",182,5),d=p("endraw",181,4),f=new m((O=>{if(35==O.next){for(O.advance();!(10==O.next||O.next<0)&&(37!=O.next&&125!=O.next||125!=O.peek(1));)O.advance();O.acceptToken(6)}})),h={__proto__:null,contains:32,or:36,and:36,true:50,false:50,empty:52,forloop:54,tablerowloop:56,continue:58,in:128,with:194,for:196,as:198,if:234,endif:238,unless:244,endunless:248,elsif:252,else:256,case:262,endcase:266,when:270,endfor:278,tablerow:284,endtablerow:288,break:292,cycle:298,echo:302,render:306,include:312,assign:316,capture:322,endcapture:326,increment:330,decrement:334},g={__proto__:null,if:82,endif:86,elsif:90,else:94,unless:100,endunless:104,case:110,endcase:114,when:118,for:126,endfor:136,tablerow:142,endtablerow:146,break:150,continue:154,cycle:158,comment:164,endcomment:170,raw:176,endraw:182,echo:186,render:190,include:202,assign:206,capture:212,endcapture:216,increment:220,decrement:224,liquid:228},b=t.deserialize({version:14,states:"HOQYOPOOOOOP'#F{'#F{OeOaO'#CdOsQhO'#CfO!bQxO'#DQO#{OPO'#DTO$ZOPO'#D^O$iOPO'#DcO$wOPO'#DkO%VOPO'#DsO%eOSO'#EOO%jOQO'#EUO%oOPO'#EhOOOP'#G`'#G`OOOP'#G]'#G]OOOP'#Fz'#FzQYOPOOOOOP-E9y-E9yOOQW'#Cg'#CgO&`Q!jO,59QO&gQ!jO'#G^OsQhO'#CsOOQW'#G^'#G^OOOP,59l,59lO)PQhO,59lOsQhO,59pOsQhO,59tO)ZQhO,59vOsQhO,59yOsQhO,5:OOsQhO,5:SO!]QhO,5:WO!]QhO,5:`O)`QhO,5:dO)eQhO,5:fO)jQhO,5:hO)oQhO,5:kO)tQhO,5:qOsQhO,5:vOsQhO,5:xOsQhO,5;OOsQhO,5;QOsQhO,5;TOsQhO,5;XOsQhO,5;ZO+TQhO,5;]O+[OPO'#CdOOOP,59o,59oO#{OPO,59oO+jQxO'#DWOOOP,59x,59xO$ZOPO,59xO+oQxO'#DaOOOP,59},59}O$iOPO,59}O+tQxO'#DfOOOP,5:V,5:VO$wOPO,5:VO+yQxO'#DqOOOP,5:_,5:_O%VOPO,5:_O,OQxO'#DvOOOS'#GQ'#GQO,TOSO'#ERO,]OSO,5:jOOOQ'#GR'#GRO,bOQO'#EXO,jOQO,5:pOOOP,5;S,5;SO%oOPO,5;SO,oQxO'#EkOOOP-E9x-E9xO,tQ#|O,59SOsQhO,59VOsQhO,59VO,yQhO'#C|OOQW'#F|'#F|O-OQhO1G.lOOOP1G.l1G.lOsQhO,59VOsQhO,59ZO-WQ!jO,59_O-iQ!jO1G/WO-pQhO1G/WOOOP1G/W1G/WO-xQ!jO1G/[O.ZQ!jO1G/`OOOP1G/b1G/bO.lQ!jO1G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AN>tOOOPAN>tAN>tOsQhO1G0fO!]QhO1G0fO!7bQ!jO7+&{O!8qQ!jO7+'PO!:QQhO7+'WO!;tQhO,5h[O]||-1},{term:37,get:O=>g[O]||-1}],tokenPrec:0});function v(O,$){return O.split(" ").map((O=>({label:O,type:$})))}const y=v("abs append at_least at_most capitalize ceil compact concat date default divided_by downcase escape escape_once first floor join last lstrip map minus modulo newline_to_br plus prepend remove remove_first replace replace_first reverse round rstrip size slice sort sort_natural split strip strip_html strip_newlines sum times truncate truncatewords uniq upcase url_decode url_encode where","function"),u=v("cycle comment endcomment raw endraw echo increment decrement liquid if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue assign capture endcapture render include","keyword"),k=v("empty forloop tablerowloop in with as contains","keyword"),_=v("first index index0 last length rindex","property"),W=v("col col0 col_first col_last first index index0 last length rindex rindex0 row","property");function T(O={}){let $=O.filters?O.filters.concat(y):y,a=O.tags?O.tags.concat(u):u,e=O.variables?O.variables.concat(k):k,{properties:i}=O;return O=>{var r;let t=function(O){var $;let{state:a,pos:e}=O,i=n(a).resolveInner(e,-1).enterUnfinishedNodesBefore(e),r=(null===($=i.childBefore(e))||void 0===$?void 0:$.name)||i.name;if("FilterName"==i.name)return{type:"filter",node:i};if(O.explicit&&"|"==r)return{type:"filter"};if("TagName"==i.name)return{type:"tag",node:i};if(O.explicit&&"{%"==r)return{type:"tag"};if("PropertyName"==i.name&&"MemberExpression"==i.parent.name)return{type:"property",node:i,target:i.parent};if("."==i.name&&"MemberExpression"==i.parent.name)return{type:"property",target:i.parent};if("MemberExpression"==i.name&&"."==r)return{type:"property",target:i};if("VariableName"==i.name)return{type:"expression",from:i.from};let t=O.matchBefore(/[\w\u00c0-\uffff]+$/);return t?{type:"expression",from:t.from}:O.explicit&&"CommentText"!=i.name&&"StringLiteral"!=i.name&&"NumberLiteral"!=i.name&&"InlineComment"!=i.name?{type:"expression"}:null}(O);if(!t)return null;let Q,c=null!==(r=t.from)&&void 0!==r?r:t.node?t.node.from:O.pos;return Q="filter"==t.type?$:"tag"==t.type?a:"expression"==t.type?e:function(O,$,a,e){let i=[];for(;;){let a=$.getChild("Expression");if(!a)return[];if("forloop"==a.name)return i.length?[]:_;if("tablerowloop"==a.name)return i.length?[]:W;if("VariableName"==a.name){i.unshift(O.sliceDoc(a.from,a.to));break}if("MemberExpression"!=a.name)return[];{let e=a.getChild("PropertyName");e&&i.unshift(O.sliceDoc(e.from,e.to)),$=a}}return e?e(i,O,a):[]}(O.state,t.target,O,i),Q.length?{options:Q,from:c,validFor:/^[\w\u00c0-\uffff]*$/}:null}}const Y=O.inputHandler.of(((O,a,e,i)=>"%"==i&&a==e&&"{}"==O.state.doc.sliceString(a-1,e+1)&&(O.dispatch(O.state.changeByRange((O=>({changes:{from:O.from,to:O.to,insert:"%%"},range:$.cursor(O.from+1)}))),{scrollIntoView:!0,userEvent:"input.type"}),!0)));function R(O){return $=>{let a=O.test($.textAfter);return $.lineIndent($.node.from)+(a?0:$.unit)}}const j=i.define({name:"liquid",parser:b.configure({props:[Q({"cycle comment endcomment raw endraw echo increment decrement liquid in with as":l.keyword,"empty forloop tablerowloop":l.atom,"if elsif else endif unless endunless case endcase for endfor tablerow endtablerow break continue":l.controlKeyword,"assign capture endcapture":l.definitionKeyword,contains:l.operatorKeyword,"render include":l.moduleKeyword,VariableName:l.variableName,TagName:l.tagName,FilterName:l.function(l.variableName),PropertyName:l.propertyName,CompareOp:l.compareOperator,AssignOp:l.definitionOperator,LogicOp:l.logicOperator,NumberLiteral:l.number,StringLiteral:l.string,BooleanLiteral:l.bool,InlineComment:l.lineComment,CommentText:l.blockComment,"{% %} {{ }}":l.brace,"( )":l.paren,".":l.derefOperator,", .. : |":l.punctuation}),c.add({Tag:s({closing:"%}"}),"UnlessDirective ForDirective TablerowDirective CaptureDirective":R(/^\s*(\{%-?\s*)?end\w/),IfDirective:R(/^\s*(\{%-?\s*)?(endif|else|elsif)\b/),CaseDirective:R(/^\s*(\{%-?\s*)?(endcase|when)\b/)}),o.add({"UnlessDirective ForDirective TablerowDirective CaptureDirective IfDirective CaseDirective RawDirective Comment"(O){let $=O.firstChild,a=O.lastChild;return $&&"Tag"==$.name?{from:$.to,to:"EndTag"==a.name?a.from:O.to}:null}})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*{%-?\s*(?:end|elsif|else|when|)$/}}),w=a();function U(O){return j.configure({wrap:r(($=>$.type.isTop?{parser:O.parser,overlay:O=>"Text"==O.name||"RawText"==O.name}:null))},"liquid")}const X=U(w.language);function G(O={}){let $=O.base||w,a=$.language==w.language?X:U($.language);return new e(a,[$.support,a.data.of({autocomplete:T(O)}),$.language.data.of({closeBrackets:{brackets:["{"]}}),Y])}export{Y as closePercentBrace,G as liquid,T as liquidCompletionSource,X as liquidLanguage};