@hyperscript-tools/multilingual 2.3.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +118 -0
  3. package/dist/hyperscript-i18n-ar.global.js +4 -0
  4. package/dist/hyperscript-i18n-bn.global.js +4 -0
  5. package/dist/hyperscript-i18n-de.global.js +4 -0
  6. package/dist/hyperscript-i18n-east-asian.global.js +4 -0
  7. package/dist/hyperscript-i18n-en.global.js +6 -0
  8. package/dist/hyperscript-i18n-es.global.js +4 -0
  9. package/dist/hyperscript-i18n-fr.global.js +4 -0
  10. package/dist/hyperscript-i18n-he.global.js +4 -0
  11. package/dist/hyperscript-i18n-hi.global.js +4 -0
  12. package/dist/hyperscript-i18n-id.global.js +4 -0
  13. package/dist/hyperscript-i18n-it.global.js +4 -0
  14. package/dist/hyperscript-i18n-ja.global.js +4 -0
  15. package/dist/hyperscript-i18n-ko.global.js +4 -0
  16. package/dist/hyperscript-i18n-lite.global.js +1 -0
  17. package/dist/hyperscript-i18n-ms.global.js +4 -0
  18. package/dist/hyperscript-i18n-pl.global.js +4 -0
  19. package/dist/hyperscript-i18n-pt.global.js +4 -0
  20. package/dist/hyperscript-i18n-qu.global.js +4 -0
  21. package/dist/hyperscript-i18n-ru.global.js +4 -0
  22. package/dist/hyperscript-i18n-slavic.global.js +4 -0
  23. package/dist/hyperscript-i18n-south-asian.global.js +4 -0
  24. package/dist/hyperscript-i18n-southeast-asian.global.js +4 -0
  25. package/dist/hyperscript-i18n-sw.global.js +4 -0
  26. package/dist/hyperscript-i18n-th.global.js +4 -0
  27. package/dist/hyperscript-i18n-tl.global.js +4 -0
  28. package/dist/hyperscript-i18n-tr.global.js +4 -0
  29. package/dist/hyperscript-i18n-uk.global.js +4 -0
  30. package/dist/hyperscript-i18n-vi.global.js +4 -0
  31. package/dist/hyperscript-i18n-western.global.js +4 -0
  32. package/dist/hyperscript-i18n-zh.global.js +4 -0
  33. package/dist/hyperscript-i18n.global.js +63 -0
  34. package/package.json +101 -4
  35. package/scripts/copy-bundles.mjs +25 -0
@@ -0,0 +1,4 @@
1
+ var HyperscriptI18n=(function(exports){'use strict';function S(r,e){return e?{type:"literal",value:r,dataType:e}:{type:"literal",value:r}}function ce(r,e){return e?{type:"selector",value:r,selectorKind:e}:{type:"selector",value:r}}function Q(r){return {type:"reference",value:r}}function pe(r,e){return {type:"property-path",object:r,property:e}}var Re=new Set(["me","you","it","result","event","target","body"]);function ke(r,e=Re){return e.has(r)}var Tr=class{constructor(r){this.namespace=r,this.enabled=this.checkEnabled();}checkEnabled(){if(typeof process<"u"&&process.env){let r=process.env.DEBUG||"";return r==="*"||r.includes("framework:*")||r.includes(`framework:${this.namespace}`)}return false}log(r,e,...t){if(!this.enabled)return;let i=`[framework:${this.namespace}]`,a=new Date().toISOString();switch(r){case "debug":console.debug(`${a} ${i} DEBUG:`,e,...t);break;case "info":console.info(`${a} ${i} INFO:`,e,...t);break;case "warn":console.warn(`${a} ${i} WARN:`,e,...t);break;case "error":console.error(`${a} ${i} ERROR:`,e,...t);break}}debug(r,...e){this.log("debug",r,...e);}info(r,...e){this.log("info",r,...e);}warn(r,...e){this.log("warn",r,...e);}error(r,...e){this.log("error",r,...e);}isEnabled(){return this.enabled}enable(){this.enabled=true;}disable(){this.enabled=false;}};function Pr(r){return new Tr(r)}function V(r,e){return !e||e.length===0||e.includes(r)||e.includes("expression")?true:r==="property-path"?e.some(t=>["selector","reference","expression"].includes(t)):false}function Rr(r,e){return r?.possessive?.keywords?.[e]}var re=class q{constructor(){this.logger=Pr("pattern-matcher"),this.stemMatchCount=0,this.totalKeywordMatches=0;}safeToLowerCase(e){return typeof e=="string"?e.toLowerCase():e==null?"":String(e).toLowerCase()}matchPattern(e,t,i){let a=e.mark(),u=new Map;if(this.logger.debug("========================================"),this.logger.debug("matchPattern ENTRY"),this.logger.debug("Pattern ID:",t.id),this.logger.debug("Pattern command:",t.command),this.logger.debug("Pattern language:",t.language),this.logger.debug("Pattern template:",JSON.stringify(t.template,null,2)),this.logger.isEnabled()){let s=[];for(let l=0;l<10;l++){let m=e.peek(l);if(m)s.push({type:m.type,value:m.value,kind:m.kind});else break}this.logger.debug("Input tokens (first 10):",s),this.logger.debug("Profile code:",i?.code);}this.currentProfile=i,this.stemMatchCount=0,this.totalKeywordMatches=0,this.logger.debug("--- Calling matchTokenSequence ---"),this.logger.debug("Pattern tokens to match:",JSON.stringify(t.template.tokens,null,2));let n=this.matchTokenSequence(e,t.template.tokens,u);if(this.logger.debug("matchTokenSequence returned:",n),this.logger.debug("Captured roles:",Array.from(u.entries()).map(([s,l])=>[s,JSON.stringify(l)])),!n)return this.logger.debug(">>> MATCH FAILED - resetting token position"),e.reset(a),null;let o=this.calculateConfidence(t,u);return this.applyExtractionRules(t,u),{pattern:t,captured:u,consumedTokens:e.position()-a.position,confidence:o}}matchBest(e,t,i){let a=[];for(let n of t){let o=e.mark(),s=this.matchPattern(e,n,i);s&&a.push(s),e.reset(o);}if(a.length===0)return null;a.sort((n,o)=>{let s=o.pattern.priority-n.pattern.priority;if(s!==0)return s;let l=o.confidence-n.confidence;return Math.abs(l)>.001?l:o.consumedTokens-n.consumedTokens});let u=a[0];return this.matchPattern(e,u.pattern),u}matchTokenSequence(e,t,i,a){let u=t[0],n=u?.type==="literal"&&(u.value==="and"||u.value==="then"||u.alternatives?.includes("and")||u.alternatives?.includes("then"));if(this.currentProfile?.code==="ar"&&!n)for(;e.peek()?.kind==="conjunction";)e.advance();let o=null,s=null;for(let l=0;l<t.length;l++){let m=t[l];this.logger.debug(" >> Matching pattern token:",JSON.stringify(m,null,2));let c=e.peek();if(this.logger.debug(" >> Current input token:",c?JSON.stringify({type:c.type,value:c.value,kind:c.kind}):"EOF"),m.type==="role"&&m.greedy){let v=this.collectStopMarkers(t,l+1);if(a)for(let k of a)v.add(k);let g=[];for(;!e.isAtEnd();){let k=e.peek();if(!k||this.isStopMarker(k,v))break;g.push(k.value),e.advance();}if(g.length>0){i.set(m.role,{type:"expression",raw:g.join(" ")}),o=null,s=null;continue}else {if(m.optional)continue;return false}}if(m.type==="group"){let v=this.collectStopMarkers(t,l+1);if(a)for(let k of a)v.add(k);if(this.matchGroupToken(e,m,i,v)){o=null,s=null;continue}if(this.isOptional(m))continue;return false}let p=m.type==="role"&&m.optional===true,d=p?e.mark():null;if(m.type==="role"&&!p){let v=l+1<t.length?t[l+1]:null;if(v?.type==="literal"){let g=e.peek();if(g&&this.getMatchType(g,v.value)!=="none"){if(this.logger.debug(" >> MARKER-STEAL GUARD: current token matches next literal, skipping role"),this.logger.debug(" >> Token match FAILED"),this.isOptional(m))continue;if(o&&s){this.logger.debug(" >> BACKTRACKING: undoing optional role",s),e.reset(o),i.delete(s),o=null,s=null;let k=this.matchPatternToken(e,m,i);if(this.logger.debug(" >> Backtrack retry result:",k),k)continue}return false}}}let E=this.matchPatternToken(e,m,i);if(this.logger.debug(" >> Match result:",E),E){p?(o=d,s=m.role):(o=null,s=null);continue}if(this.logger.debug(" >> Token match FAILED"),!this.isOptional(m)){if(o&&s){this.logger.debug(" >> BACKTRACKING: undoing optional role",s),e.reset(o),i.delete(s),o=null,s=null;let v=this.matchPatternToken(e,m,i);if(this.logger.debug(" >> Backtrack retry result:",v),v)continue}return false}}return true}matchPatternToken(e,t,i){switch(t.type){case "literal":return this.matchLiteralToken(e,t);case "role":return this.matchRoleToken(e,t,i);case "group":return this.matchGroupToken(e,t,i);default:return false}}matchLiteralToken(e,t){let i=e.peek();if(this.logger.debug(" >>> matchLiteralToken: expecting",t.value),this.logger.debug(" >>> matchLiteralToken: got token",i?JSON.stringify({type:i.type,value:i.value,kind:i.kind}):"null"),!i)return this.logger.debug(" >>> matchLiteralToken: FAIL - no token"),false;let a=this.getMatchType(i,t.value);if(this.logger.debug(" >>> matchType for",i.value,"vs",t.value,":",a),a!=="none")return this.totalKeywordMatches++,a==="stem"&&this.stemMatchCount++,e.advance(),true;if(t.alternatives)for(let u of t.alternatives){let n=this.getMatchType(i,u);if(n!=="none")return this.totalKeywordMatches++,n==="stem"&&this.stemMatchCount++,e.advance(),true}return false}matchRoleToken(e,t,i){this.logger.debug(" >>> matchRoleToken ENTRY: capturing role",t.role),this.logger.debug(" >>> matchRoleToken: expected types",t.expectedTypes),this.logger.debug(" >>> matchRoleToken: optional?",t.optional),this.skipNoiseWords(e);let a=e.peek();if(this.logger.debug(" >>> After skipNoiseWords, current token:",a?JSON.stringify({value:a.value,kind:a.kind}):"null"),!a)return t.optional||false;let u=this.tryMatchPossessiveExpression(e);if(u)return t.expectedTypes&&t.expectedTypes.length>0&&!V(u.type,t.expectedTypes)?t.optional||false:(i.set(t.role,u),true);let n=this.tryMatchMethodCallExpression(e);if(n)return t.expectedTypes&&t.expectedTypes.length>0&&!V(n.type,t.expectedTypes)?t.optional||false:(i.set(t.role,n),true);let o=this.tryMatchPossessiveSelectorExpression(e);if(o)return t.expectedTypes&&t.expectedTypes.length>0&&!V(o.type,t.expectedTypes)?t.optional||false:(i.set(t.role,o),true);let s=this.tryMatchPropertyAccessExpression(e);if(s)return t.expectedTypes&&t.expectedTypes.length>0&&!V(s.type,t.expectedTypes)?t.optional||false:(i.set(t.role,s),true);let l=this.tryMatchSelectorPropertyExpression(e);if(l)return t.expectedTypes&&t.expectedTypes.length>0&&!V(l.type,t.expectedTypes)?t.optional||false:(i.set(t.role,l),true);this.logger.debug(" >>> Trying tokenToSemanticValue for token:",a?JSON.stringify({value:a.value,kind:a.kind}):"null");let m=this.tokenToSemanticValue(a);return this.logger.debug(" >>> tokenToSemanticValue returned:",m?JSON.stringify(m):"null"),m?(this.logger.debug(" >>> Validating type:",m.type,"against expected:",t.expectedTypes),t.expectedTypes&&t.expectedTypes.length>0&&!V(m.type,t.expectedTypes)?(this.logger.debug(" >>> TYPE MISMATCH - returning",t.optional||false),t.optional||false):(this.logger.debug(" >>> Type validation PASSED"),i.set(t.role,m),e.advance(),true)):t.optional||false}tryMatchPossessiveExpression(e){let t=e.peek();if(!t||!this.currentProfile)return null;let i=t.normalized||t.value,a=this.safeToLowerCase(i),u=Rr(this.currentProfile,a);if(!u)return null;let n=e.mark();e.advance();let o=e.peek();if(!o)return e.reset(n),null;if(o.kind==="identifier"||o.kind==="keyword"&&!this.isStructuralKeyword(o.value)||o.kind==="selector"&&o.value.startsWith("*")||o.kind==="selector"&&o.value.startsWith("@")||o.kind==="selector"&&o.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(o.value)){e.advance();let s=o.value;o.kind==="selector"&&s.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(s)&&(s=s.substring(1));let l=s;for(;e.peek()?.kind==="selector"&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)l+=e.peek().value,e.advance();let m=e.peek();return m?.kind==="literal"&&m.value.startsWith("(")&&(l+=m.value,e.advance()),pe(Q(u),l)}return e.reset(n),null}isStructuralKeyword(e){return new Set(["into","in","to","from","at","by","with","without","before","after","of","as","on","then","end","else","if","repeat","while","for","toggle","add","remove","put","set","show","hide","increment","decrement","send","trigger","call"]).has(e.toLowerCase())}tryMatchMethodCallExpression(e){let t=e.peek();if(!t||t.kind!=="selector")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="operator"||a.value!==".")return e.reset(i),null;e.advance();let u=e.peek();if(!u||u.kind!=="identifier")return e.reset(i),null;e.advance();let n=e.peek();if(!n||n.kind!=="punctuation"||n.value!=="(")return e.reset(i),null;e.advance();let o=[];for(;!e.isAtEnd()&&o.length<q.MAX_METHOD_ARGS;){let l=e.peek();if(!l)break;if(l.kind==="punctuation"&&l.value===")"){e.advance();break}if(l.kind==="punctuation"&&l.value===","){e.advance();continue}o.push(l.value),e.advance();}return {type:"expression",raw:`${t.value}.${u.value}(${o.join(", ")})`}}tryMatchPropertyAccessExpression(e){let t=e.peek();if(!t||t.kind!=="identifier"&&t.kind!=="keyword")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="operator"||a.value!==".")return e.reset(i),null;e.advance();let u=e.peek();if(!u||u.kind!=="identifier")return e.reset(i),null;e.advance();let n=`${t.value}.${u.value}`,o=1;for(;!e.isAtEnd()&&o<q.MAX_PROPERTY_DEPTH;){let l=e.peek();if(!l||l.kind!=="operator"||l.value!==".")break;e.advance();let m=e.peek();if(!m||m.kind!=="identifier")break;e.advance(),n+=`.${m.value}`,o++;}let s=e.peek();if(s&&s.kind==="punctuation"&&s.value==="("){e.advance();let l=[],m=0;for(;!e.isAtEnd()&&l.length<q.MAX_METHOD_ARGS;){let p=e.peek();if(!p)break;if(p.kind==="punctuation"&&p.value===")"){if(m===0){e.advance();break}m--;}if(p.kind==="punctuation"&&p.value==="("&&m++,p.kind==="punctuation"&&p.value===","){e.advance();continue}l.push(p.value),e.advance();}return {type:"expression",raw:`${n}(${l.join(", ")})`}}return {type:"expression",raw:n}}tryMatchPossessiveSelectorExpression(e){let t=e.peek();if(!t||t.kind!=="selector")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="punctuation"||a.value!=="'s")return e.reset(i),null;e.advance();let u=e.peek();return !u||u.kind!=="selector"&&u.kind!=="identifier"?(e.reset(i),null):(e.advance(),pe(ce(t.value),u.value))}tryMatchSelectorPropertyExpression(e){let t=e.peek();if(!t||t.kind!=="selector"||typeof t.value!="string"||!t.value.startsWith("#"))return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="selector"||!a.value.startsWith("."))return e.reset(i),null;let u=e.peek(1);u&&u.kind,e.advance();let n=a.value.slice(1);return pe(ce(t.value),n)}matchGroupToken(e,t,i,a){let u=e.mark(),n=new Set(i.keys());if(this.matchTokenSequence(e,t.tokens,i,a))return true;e.reset(u);for(let l of i.keys())n.has(l)||i.delete(l);if(!t.optional)return false;let s=this.getGroupLeadingMarker(t);if(s)for(let l=1;l<=q.MAX_MARKER_SCAN;l++){let m=e.peek(l);if(!m)break;if((m.normalized||m.value).toLowerCase()===s){this.logger.debug(" >> MARKER SCAN: found",s,"at offset",l,"- skipping intervening tokens");for(let d=0;d<l;d++)e.advance();if(this.matchTokenSequence(e,t.tokens,i,a))return true;e.reset(u);for(let d of i.keys())n.has(d)||i.delete(d);break}}return true}getGroupLeadingMarker(e){let t=e.tokens[0];return t?.type==="literal"?t.value.toLowerCase():null}getMatchType(e,t){return e.value===t?"exact":e.normalized===t?"normalized":e.stem===t&&e.stemConfidence!==void 0&&e.stemConfidence>=.7?"stem":e.kind==="keyword"&&this.safeToLowerCase(e.value)===t.toLowerCase()?"case-insensitive":"none"}collectStopMarkers(e,t){let i=new Set;for(let a=t;a<e.length;a++){let u=e[a];if(u.type==="literal"){if(i.add(u.value.toLowerCase()),u.alternatives)for(let n of u.alternatives)i.add(n.toLowerCase());break}if(u.type==="group"){for(let n of u.tokens)if(n.type==="literal"){if(i.add(n.value.toLowerCase()),n.alternatives)for(let o of n.alternatives)i.add(o.toLowerCase());break}if(!u.optional)break}}return i}isStopMarker(e,t){return t.size===0?false:!!(t.has(e.value.toLowerCase())||e.normalized&&t.has(e.normalized.toLowerCase()))}tokenToSemanticValue(e){switch(e.kind){case "selector":return ce(e.value);case "literal":return this.parseLiteralValue(e.value);case "keyword":let t=e.normalized||e.value;this.safeToLowerCase(t);return S(e.normalized||e.value);case "identifier":if(typeof e.value=="string"&&e.value.startsWith(":"))return Q(e.value);this.safeToLowerCase(e.value);return {type:"expression",raw:e.value};case "url":return S(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300C")){let a=e.slice(1,-1);return S(a,"string")}if(e==="true")return S(true,"boolean");if(e==="false")return S(false,"boolean");let t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(t){let a=parseFloat(t[1]);return t[2]?S(e,"duration"):S(a,"number")}let i=parseFloat(e);return isNaN(i)?S(e,"string"):S(i,"number")}applyExtractionRules(e,t){for(let[i,a]of Object.entries(e.extraction))t.has(i)||(a.value!==void 0?t.set(i,{type:"literal",value:a.value}):a.default&&t.set(i,a.default));}isOptional(e){return e.type!=="literal"&&e.optional===true}calculateConfidence(e,t){let i=0,a=0,u=l=>e.extraction?.[l]?.default!==void 0;for(let l of e.template.tokens)if(l.type==="role")a+=1,t.has(l.role)&&(i+=1);else if(l.type==="group"){for(let m of l.tokens)if(m.type==="role"){let c=u(m.role),p=.8;a+=p,t.has(m.role)?i+=p:c&&(i+=p*.6);}}let n=a>0?i/a:1;if(this.stemMatchCount>0&&this.totalKeywordMatches>0){let l=this.stemMatchCount/this.totalKeywordMatches*.15;n=Math.max(.5,n-l);}let o=this.calculateVSOConfidenceBoost(e);n=Math.min(1,n+o);let s=this.arabicPrepositionDisambiguation(e,t);return n=Math.max(0,Math.min(1,n+s)),n}calculateVSOConfidenceBoost(e){if(e.language!=="ar")return 0;let t=e.template.tokens[0];if(!t||t.type!=="literal")return 0;let i=new Set(["\u0628\u062F\u0644","\u063A\u064A\u0631","\u0623\u0636\u0641","\u0623\u0632\u0644","\u0636\u0639","\u0627\u062C\u0639\u0644","\u0639\u064A\u0646","\u0632\u062F","\u0627\u0646\u0642\u0635","\u0633\u062C\u0644","\u0623\u0638\u0647\u0631","\u0623\u062E\u0641","\u0634\u063A\u0644","\u0623\u0631\u0633\u0644","\u0631\u0643\u0632","\u0634\u0648\u0634","\u062A\u0648\u0642\u0641","\u0627\u0646\u0633\u062E","\u0627\u062D\u0630\u0641","\u0627\u0635\u0646\u0639","\u0627\u0646\u062A\u0638\u0631","\u0627\u0646\u062A\u0642\u0627\u0644","\u0623\u0648"]);if(i.has(t.value))return .15;if(t.alternatives){for(let a of t.alternatives)if(i.has(a))return .15}return 0}arabicPrepositionDisambiguation(e,t){if(e.language!=="ar")return 0;let i=0,a={patient:["\u0639\u0644\u0649"],destination:["\u0625\u0644\u0649","\u0627\u0644\u0649"],source:["\u0645\u0646"],agent:["\u0645\u0646"],manner:["\u0628"],style:["\u0628"],goal:["\u0625\u0644\u0649","\u0627\u0644\u0649"],method:["\u0628"]};for(let[u,n]of t.entries()){let o=a[u];if(!o||o.length===0)continue;let s="metadata"in n?n.metadata:void 0;if(s&&typeof s.prepositionValue=="string"){let l=s.prepositionValue;o.includes(l)?i+=.1:i-=.1;}}return Math.max(-0.1,Math.min(.1,i))}skipNoiseWords(e){let t=e.peek();if(!t)return;let i=this.safeToLowerCase(t.value);if(q.ENGLISH_NOISE_WORDS.has(i)){let a=e.mark();e.advance();let u=e.peek();if(u&&u.kind==="selector")return;e.reset(a);}i==="class"&&e.advance();}extractEventModifiers(e){let t={},i=false;for(;!e.isAtEnd();){let a=e.peek();if(!a||a.kind!=="event-modifier")break;let u=a.metadata;if(!u)break;switch(i=true,u.modifierName){case "once":t.once=true;break;case "debounce":typeof u.value=="number"&&(t.debounce=u.value);break;case "throttle":typeof u.value=="number"&&(t.throttle=u.value);break;case "queue":(u.value==="first"||u.value==="last"||u.value==="all"||u.value==="none")&&(t.queue=u.value);break}e.advance();}return i?t:void 0}};re.MAX_MARKER_SCAN=3;re.MAX_PROPERTY_DEPTH=10;re.MAX_METHOD_ARGS=20;re.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var Nr=re;new Nr;var W=class{constructor(){this.name="string-literal";}canExtract(r,e){let t=r[e];return t==='"'||t==="'"||t==="`"||t==="\u201C"||t==="\u2018"}extract(r,e){let t=r[e];if(t==="\u201C"){let u=1;for(;e+u<r.length;){if(r[e+u]==="\u201D")return u++,{value:r.substring(e,e+u),length:u};u++;}return null}if(t==="\u2018"){let u=1;for(;e+u<r.length;){if(r[e+u]==="\u2019")return u++,{value:r.substring(e,e+u),length:u};u++;}return null}let i=1,a=false;for(;e+i<r.length;){let u=r[e+i];if(a){a=false,i++;continue}if(u==="\\"){a=true,i++;continue}if(u===t)return i++,{value:r.substring(e,e+i),length:i};i++;}return null}},U=class{constructor(){this.name="number";}canExtract(r,e){return /\d/.test(r[e])}extract(r,e){let t=0,i=false;for(;e+t<r.length;){let n=r[e+t];if(/\d/.test(n))t++;else if(n==="."&&!i)i=true,t++;else break}if(t===0)return null;let a=r.substring(e,e+t),u=e+t;if(u<r.length){let n=r.slice(u),o=[{pattern:"\u6BEB\u79D2",suffix:"ms"},{pattern:"\u5206\u949F",suffix:"m"},{pattern:"\u5C0F\u65F6",suffix:"h"},{pattern:"\u30DF\u30EA\u79D2",suffix:"ms"},{pattern:"\u6642\u9593",suffix:"h"}];for(let l of o)if(n.startsWith(l.pattern))return {value:a+l.suffix,length:t+l.pattern.length,metadata:{hasTimeUnit:true}};if(n.startsWith("ms"))return {value:a+"ms",length:t+2,metadata:{hasTimeUnit:true}};let s=[{pattern:"\u79D2",suffix:"s"},{pattern:"\u5206",suffix:"m"}];for(let l of s)if(n.startsWith(l.pattern))return {value:a+l.suffix,length:t+1,metadata:{hasTimeUnit:true}};if(/^[smh](?![a-zA-Z])/.test(n))return {value:a+n[0],length:t+1,metadata:{hasTimeUnit:true}}}return {value:a,length:t}}};function _r(r){return "setContext"in r&&typeof r.setContext=="function"}function Or(r){let e={language:r.language,direction:r.direction,lookupKeyword:r.lookupKeyword.bind(r),isKeyword:r.isKeyword.bind(r),isKeywordStart:r.isKeywordStart.bind(r)};return r.normalizer?{...e,normalizer:r.normalizer}:e}var te=class{constructor(r,e){this.pos=0,this.tokens=r,this.language=e;}peek(r=0){let e=this.pos+r;return e<0||e>=this.tokens.length?null:this.tokens[e]}advance(){if(this.isAtEnd())throw new Error("Unexpected end of token stream");return this.tokens[this.pos++]}isAtEnd(){return this.pos>=this.tokens.length}mark(){return {position:this.pos}}reset(r){this.pos=r.position;}position(){return this.pos}remaining(){return this.tokens.slice(this.pos)}takeWhile(r){let e=[];for(;!this.isAtEnd()&&r(this.peek());)e.push(this.advance());return e}skipWhile(r){for(;!this.isAtEnd()&&r(this.peek());)this.advance();}};function C(r,e){return {start:r,end:e}}function b(r,e,t,i){if(typeof r=="object"){let{value:u,kind:n,position:o,normalized:s,stem:l,stemConfidence:m,metadata:c}=r;return {value:u,kind:n,position:o,...s!==void 0&&{normalized:s},...l!==void 0&&{stem:l},...m!==void 0&&{stemConfidence:m},...c!==void 0&&{metadata:c}}}let a=r;if(!e||!t)throw new Error("createToken requires kind and position parameters");if(typeof i=="string")return {value:a,kind:e,position:t,normalized:i};if(i){let{normalized:u,stem:n,stemConfidence:o,metadata:s}=i;return {value:a,kind:e,position:t,...u!==void 0&&{normalized:u},...n!==void 0&&{stem:n},...o!==void 0&&{stemConfidence:o},...s!==void 0&&{metadata:s}}}return {value:a,kind:e,position:t}}function ee(r){return /\s/.test(r)}function Mr(r){return r==="#"||r==="."||r==="["||r==="@"||r==="*"||r==="<"}function Ir(r){return r==='"'||r==="'"||r==="`"||r==="\u300C"||r==="\u300D"}function M(r){return /\d/.test(r)}function jr(r){return /[a-zA-Z]/.test(r)}function x(r){return /[a-zA-Z0-9_-]/.test(r)}function Lr(r,e){if(e>=r.length)return null;let t=r[e];if(!Mr(t))return null;let i=e,a="";if(t==="#"||t==="."){for(a+=r[i++];i<r.length&&x(r[i]);)a+=r[i++];if(a.length<=1)return null;if(i<r.length&&r[i]==="."&&t==="#"){let n=i+1;for(;n<r.length&&x(r[n]);)n++;if(n<r.length&&r[n]==="(")return a}}else if(t==="["){let u=1,n=false,o=null,s=false;for(a+=r[i++];i<r.length&&u>0;){let l=r[i];a+=l,s?s=false:l==="\\"?s=true:n?l===o&&(n=false,o=null):l==='"'||l==="'"||l==="`"?(n=true,o=l):l==="["?u++:l==="]"&&u--,i++;}if(u!==0)return null}else if(t==="@"){for(a+=r[i++];i<r.length&&x(r[i]);)a+=r[i++];if(a.length<=1)return null}else if(t==="*"){for(a+=r[i++];i<r.length&&x(r[i]);)a+=r[i++];if(a.length<=1)return null}else if(t==="<"){if(a+=r[i++],i>=r.length||!jr(r[i]))return null;for(;i<r.length&&x(r[i]);)a+=r[i++];for(;i<r.length;){let u=r[i];if(u==="."){if(a+=r[i++],i>=r.length||!x(r[i]))return null;for(;i<r.length&&x(r[i]);)a+=r[i++];}else if(u==="#"){if(a+=r[i++],i>=r.length||!x(r[i]))return null;for(;i<r.length&&x(r[i]);)a+=r[i++];}else if(u==="["){let n=1,o=false,s=null,l=false;for(a+=r[i++];i<r.length&&n>0;){let m=r[i];a+=m,l?l=false:m==="\\"?l=true:o?m===s&&(o=false,s=null):m==='"'||m==="'"||m==="`"?(o=true,s=m):m==="["?n++:m==="]"&&n--,i++;}if(n!==0)return null}else break}for(;i<r.length&&ee(r[i]);)a+=r[i++];if(i<r.length&&r[i]==="/")for(a+=r[i++];i<r.length&&ee(r[i]);)a+=r[i++];if(i>=r.length||r[i]!==">")return null;a+=r[i++];}return a||null}function $r(r,e){if(e>=r.length||r[e]!=="'"||e+1>=r.length||r[e+1].toLowerCase()!=="s")return false;if(e+2>=r.length)return true;let i=r[e+2];return ee(i)||i==="*"||!x(i)}function Vr(r,e){if(e>=r.length)return null;let t=r[e];if(!Ir(t)||t==="'"&&$r(r,e))return null;let a={'"':'"',"'":"'","`":"`","\u300C":"\u300D"}[t];if(!a)return null;let u=e+1,n=t,o=false;for(;u<r.length;){let s=r[u];if(n+=s,o)o=false;else if(s==="\\")o=true;else if(s===a)return n;u++;}return n}function qr(r,e){if(e>=r.length)return false;let t=r[e],i=r[e+1]||"",a=r[e+2]||"";if(t==="/"&&i!=="/"&&/[a-zA-Z0-9._-]/.test(i)||t==="/"&&i==="/"&&/[a-zA-Z]/.test(a)||t==="."&&(i==="/"||i==="."&&a==="/"))return true;let u=r.slice(e,e+8).toLowerCase();return !!(u.startsWith("http://")||u.startsWith("https://"))}function Wr(r,e){if(!qr(r,e))return null;let t=e,i="",a=/[a-zA-Z0-9/:._\-?&=%@+~!$'()*,;[\]]/;for(;t<r.length;){let u=r[t];if(u==="#"){if(i.length>0&&/[a-zA-Z0-9/.]$/.test(i))for(i+=u,t++;t<r.length&&/[a-zA-Z0-9_-]/.test(r[t]);)i+=r[t++];break}if(a.test(u))i+=u,t++;else break}return i.length<2?null:i}function Ur(r,e){if(e>=r.length)return null;let t=r[e];if(!M(t)&&t!=="-"&&t!=="+")return null;let i=e,a="";if((r[i]==="-"||r[i]==="+")&&(a+=r[i++]),i>=r.length||!M(r[i]))return null;for(;i<r.length&&M(r[i]);)a+=r[i++];if(i<r.length&&r[i]===".")for(a+=r[i++];i<r.length&&M(r[i]);)a+=r[i++];return i<r.length&&(r.slice(i,i+2)==="ms"?a+="ms":(r[i]==="s"||r[i]==="m"||r[i]==="h")&&(a+=r[i])),a}var Kr=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"];new Set(Kr);var Oe=class Me{constructor(){this.profileKeywords=[],this.profileKeywordMap=new Map,this.extractors=[];}tokenize(e){if(this.isUsingExtractors())return this.tokenizeWithExtractors(e);throw new Error(`${this.constructor.name}: tokenize() not implemented and no extractors registered. Either register extractors or override tokenize() method.`)}registerExtractor(e){_r(e)&&e.setContext(Or(this)),this.extractors.push(e);}registerExtractors(e){for(let t of e)this.registerExtractor(t);}clearExtractors(){this.extractors=[];}isUsingExtractors(){return this.extractors.length>0}tokenizeWithExtractors(e){let t=[],i=0;for(;i<e.length;){for(;i<e.length&&ee(e[i]);)i++;if(i>=e.length)break;let a=false;for(let u of this.extractors)if(u.canExtract(e,i)){let n=u.extract(e,i);if(n){let o=n.metadata?.normalized,s=n.metadata?.stem,l=n.metadata?.stemConfidence,m={};if(n.metadata)for(let[p,d]of Object.entries(n.metadata))p!=="normalized"&&p!=="stem"&&p!=="stemConfidence"&&(m[p]=d);let c={};o&&(c.normalized=o),s&&(c.stem=s),l!==void 0&&(c.stemConfidence=l),Object.keys(m).length>0&&(c.metadata=m),t.push(b(n.value,this.classifyToken(n.value),C(i,i+n.length),Object.keys(c).length>0?c:void 0)),i+=n.length,a=true;break}}if(!a){let u=e[i],n=this.classifyUnknownChar(u);t.push(b(u,n,C(i,i+1))),i++;}}return new te(t,this.language)}classifyUnknownChar(e){return "()[]{},:;".includes(e)?"punctuation":"+-*/<>=!&|".includes(e)?"operator":"identifier"}tryPropertyAccess(e,t,i){if(e[t]!==".")return false;let a=i[i.length-1],u=a&&a.position.end<t;if(a&&!u&&(a.kind==="identifier"||a.kind==="keyword"||a.kind==="selector"))return i.push(b(".","operator",C(t,t+1))),true;let s=t+1;for(;s<e.length&&x(e[s]);)s++;return s<e.length&&e[s]==="("?(i.push(b(".","operator",C(t,t+1))),true):false}initializeKeywordsFromProfile(e,t=[]){let i=new Map;if(e.keywords){for(let[a,u]of Object.entries(e.keywords))if(i.set(u.primary,{native:u.primary,normalized:u.normalized||a}),u.alternatives)for(let n of u.alternatives)i.set(n,{native:n,normalized:u.normalized||a});}if(e.references){for(let[a,u]of Object.entries(e.references))i.set(u,{native:u,normalized:a});for(let a of Object.keys(e.references))i.has(a)||i.set(a,{native:a,normalized:a});}if(e.roleMarkers){for(let[a,u]of Object.entries(e.roleMarkers))if(u.primary&&i.set(u.primary,{native:u.primary,normalized:a}),u.alternatives)for(let n of u.alternatives)i.set(n,{native:n,normalized:a});}if(e.possessive?.keywords)for(let[a,u]of Object.entries(e.possessive.keywords))i.set(a,{native:a,normalized:u});for(let a of t)i.set(a.native,a);this.profileKeywords=Array.from(i.values()).sort((a,u)=>u.native.length-a.native.length),this.profileKeywordMap=new Map;for(let a of this.profileKeywords){this.profileKeywordMap.set(a.native.toLowerCase(),a);let u=this.removeDiacritics(a.native);u!==a.native&&!this.profileKeywordMap.has(u.toLowerCase())&&this.profileKeywordMap.set(u.toLowerCase(),a);}}removeDiacritics(e){return e.replace(/[\u064B-\u0652\u0670]/g,"")}tryProfileKeyword(e,t){for(let i of this.profileKeywords)if(e.slice(t).startsWith(i.native))return b(i.native,"keyword",C(t,t+i.native.length),i.normalized);return null}isKeywordStart(e,t){let i=e.slice(t);return this.profileKeywords.some(a=>i.startsWith(a.native))}lookupKeyword(e){return this.profileKeywordMap.get(e.toLowerCase())}isKeyword(e){return this.profileKeywordMap.has(e.toLowerCase())}setNormalizer(e){this.normalizer=e;}tryNormalize(e){if(!this.normalizer)return null;let t=this.normalizer.normalize(e);return t.stem!==e&&t.confidence>=.7?t:null}tryMorphKeywordMatch(e,t,i){let a=this.tryNormalize(e);if(!a)return null;let u=this.lookupKeyword(a.stem);if(!u)return null;let n={normalized:u.normalized,stem:a.stem,stemConfidence:a.confidence};return b(e,"keyword",C(t,i),n)}trySelector(e,t){let i=Lr(e,t);return i?b(i,"selector",C(t,t+i.length)):null}tryEventModifier(e,t){if(e[t]!==".")return null;let i=e.slice(t).match(/^\.(?:once|debounce|throttle|queue)(?:\(([^)]+)\))?(?:\s|$|\.)/);if(!i)return null;let a=i[0].replace(/(\s|\.)$/,""),u=a.slice(1).split("(")[0],n=i[1];return {...b(a,"event-modifier",C(t,t+a.length)),metadata:{modifierName:u,value:n?u==="queue"?n:parseInt(n,10):void 0}}}tryString(e,t){let i=Vr(e,t);return i?b(i,"literal",C(t,t+i.length)):null}tryNumber(e,t){let i=Ur(e,t);return i?b(i,"literal",C(t,t+i.length)):null}tryMatchTimeUnit(e,t,i,a=false){let u=t;if(a)for(;u<e.length&&ee(e[u]);)u++;let n=e.slice(u);for(let o of i){let s=n.slice(0,o.length);if(o.caseInsensitive?s.toLowerCase()===o.pattern.toLowerCase():s===o.pattern){if(o.notFollowedBy&&(n[o.length]||"")===o.notFollowedBy)continue;if(o.checkBoundary){let m=n[o.length]||"";if(x(m))continue}return {suffix:o.suffix,endPos:u+o.length}}}return null}parseBaseNumber(e,t,i=true){let a=t,u="";if(i&&(e[a]==="-"||e[a]==="+")&&(u+=e[a++]),a>=e.length||!M(e[a]))return null;for(;a<e.length&&M(e[a]);)u+=e[a++];if(a<e.length&&e[a]===".")for(u+=e[a++];a<e.length&&M(e[a]);)u+=e[a++];return !u||u==="-"||u==="+"?null:{number:u,endPos:a}}tryNumberWithTimeUnits(e,t,i,a={}){let{allowSign:u=true,skipWhitespace:n=false}=a,o=this.parseBaseNumber(e,t,u);if(!o)return null;let{number:s,endPos:l}=o,m=[...i,...Me.STANDARD_TIME_UNITS],c=this.tryMatchTimeUnit(e,l,m,n);return c&&(s+=c.suffix,l=c.endPos),b(s,"literal",C(t,l))}tryUrl(e,t){let i=Wr(e,t);return i?b(i,"url",C(t,t+i.length)):null}tryVariableRef(e,t){if(e[t]!==":"||t+1>=e.length||!x(e[t+1]))return null;let i=t+1;for(;i<e.length&&x(e[i]);)i++;let a=e.slice(t,i);return b(a,"identifier",C(t,i))}tryOperator(e,t){let i=e.slice(t,t+2);if(["==","!=","<=",">=","&&","||","->"].includes(i))return b(i,"operator",C(t,t+2));let a=e[t];return ["<",">","!","+","-","*","/","="].includes(a)?b(a,"operator",C(t,t+1)):["(",")","{","}",",",";",":"].includes(a)?b(a,"punctuation",C(t,t+1)):null}tryMultiCharParticle(e,t,i){for(let a of i)if(e.slice(t,t+a.length)===a)return b(a,"particle",C(t,t+a.length));return null}};Oe.STANDARD_TIME_UNITS=[{pattern:"ms",suffix:"ms",length:2},{pattern:"s",suffix:"s",length:1,checkBoundary:true},{pattern:"m",suffix:"m",length:1,checkBoundary:true,notFollowedBy:"s"},{pattern:"h",suffix:"h",length:1,checkBoundary:true}];var K=Oe;function w(r){return {stem:r,confidence:1}}function y(r,e,t){return t?{stem:r,confidence:e,metadata:t}:{stem:r,confidence:e}}var Gr=Object.defineProperty,Hr=Object.getOwnPropertyNames,Je=(r,e)=>function(){return r&&(e=(0, r[Hr(r)[0]])(r=0)),e},Yr=(r,e)=>{for(var t in e)Gr(r,t,{get:e[t],enumerable:true});};function Ie(r,e){return r.replace(/\{(\w+)\}/g,(t,i)=>String(e[i]??`{${i}}`))}function B(r,e,t={},i){let a=Xe[r],u=Ie(a,t),n=Ze[r],o=n?Ie(n,t):void 0;return {code:r,message:u,severity:e,...i&&{role:i},...o&&{suggestion:o}}}var h,Xe,Ze,Jr=Je({"src/generators/schema-error-codes.ts"(){h={AMBIGUOUS_TYPE_LITERAL_SELECTOR:"SCHEMA_AMBIGUOUS_TYPE_LITERAL_SELECTOR",TOO_MANY_EXPECTED_TYPES:"SCHEMA_TOO_MANY_EXPECTED_TYPES",MULTI_TYPE_PATIENT_EXPECTED:"SCHEMA_MULTI_TYPE_PATIENT_EXPECTED",NO_REQUIRED_ROLES:"SCHEMA_NO_REQUIRED_ROLES",NO_REQUIRED_ROLES_EXPECTED:"SCHEMA_NO_REQUIRED_ROLES_EXPECTED",TRANSITION_PATIENT_ACCEPTS_SELECTOR:"SCHEMA_TRANSITION_PATIENT_ACCEPTS_SELECTOR",TRANSITION_MISSING_GOAL:"SCHEMA_TRANSITION_MISSING_GOAL",EVENT_HANDLER_MISSING_EVENT:"SCHEMA_EVENT_HANDLER_MISSING_EVENT",EVENT_HANDLER_EVENT_NOT_REQUIRED:"SCHEMA_EVENT_HANDLER_EVENT_NOT_REQUIRED",CONDITIONAL_MISSING_CONDITION:"SCHEMA_CONDITIONAL_MISSING_CONDITION",CONDITIONAL_CONDITION_NOT_REQUIRED:"SCHEMA_CONDITIONAL_CONDITION_NOT_REQUIRED",FOR_LOOP_MISSING_SOURCE:"SCHEMA_FOR_LOOP_MISSING_SOURCE",WHILE_LOOP_MISSING_CONDITION:"SCHEMA_WHILE_LOOP_MISSING_CONDITION",VALUE_TYPE_MISMATCH:"SCHEMA_VALUE_TYPE_MISMATCH",SELECTOR_KIND_MISMATCH:"SCHEMA_SELECTOR_KIND_MISMATCH",SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE:"SCHEMA_SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE",KEYWORD_COLLISION:"PROFILE_KEYWORD_COLLISION"},Xe={[h.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Role '{role}' accepts both 'literal' and 'selector'. This may cause ambiguous type inference for values starting with special characters (* . # etc.).",[h.TOO_MANY_EXPECTED_TYPES]:"Role '{role}' accepts {count} different types. This may make type inference unreliable.",[h.MULTI_TYPE_PATIENT_EXPECTED]:"Role '{role}' accepts multiple types (expected for {command} command).",[h.NO_REQUIRED_ROLES]:"Command has no required roles. Is this intentional?",[h.NO_REQUIRED_ROLES_EXPECTED]:"Command has no required roles (expected for {command}).",[h.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Transition command 'patient' role (CSS property name) should only accept 'literal', not 'selector'. CSS property names like 'background-color' are strings, not CSS selectors.",[h.TRANSITION_MISSING_GOAL]:"Transition command requires a 'goal' role for the target value (to <value>). Without it, there's no way to specify what value to transition to.",[h.EVENT_HANDLER_MISSING_EVENT]:"Event handler command should have an 'event' role to specify which event to listen for.",[h.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Event role should be required - every event handler needs an event to listen for.",[h.CONDITIONAL_MISSING_CONDITION]:"Conditional command should have a 'condition' role for the boolean expression.",[h.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Condition role should be required - conditionals need a condition to evaluate.",[h.FOR_LOOP_MISSING_SOURCE]:"For-loop should have a 'source' role for the collection to iterate over.",[h.WHILE_LOOP_MISSING_CONDITION]:"While-loop should have a 'condition' role for the loop condition.",[h.VALUE_TYPE_MISMATCH]:"Role '{role}' of command '{command}' expects type [{expectedTypes}], got '{actualType}'.",[h.SELECTOR_KIND_MISMATCH]:"Role '{role}' of command '{command}' expects selector kind [{selectorKinds}], got '{actualKind}'.",[h.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Role '{role}' has selectorKinds but expectedTypes does not include 'selector'.",[h.KEYWORD_COLLISION]:"Keyword '{keyword}' is used by multiple commands: {commands}. Only the first-registered command will be reachable."},Ze={[h.AMBIGUOUS_TYPE_LITERAL_SELECTOR]:"Consider being more specific about which type is expected, or use explicit type markers.",[h.TOO_MANY_EXPECTED_TYPES]:"Consider narrowing the accepted types to improve type inference reliability.",[h.TRANSITION_PATIENT_ACCEPTS_SELECTOR]:"Remove 'selector' from expectedTypes and only accept 'literal'.",[h.TRANSITION_MISSING_GOAL]:"Add a 'goal' role with expectedTypes ['literal', 'variable'].",[h.EVENT_HANDLER_MISSING_EVENT]:"Add an 'event' role with expectedTypes ['literal'].",[h.EVENT_HANDLER_EVENT_NOT_REQUIRED]:"Set required: true on the 'event' role.",[h.CONDITIONAL_MISSING_CONDITION]:"Add a 'condition' role with expectedTypes ['expression'].",[h.CONDITIONAL_CONDITION_NOT_REQUIRED]:"Set required: true on the 'condition' role.",[h.FOR_LOOP_MISSING_SOURCE]:"Add a 'source' role for the collection to iterate over.",[h.WHILE_LOOP_MISSING_CONDITION]:"Add a 'condition' role for the loop continuation condition.",[h.VALUE_TYPE_MISMATCH]:"Ensure the value matches one of the expected types: [{expectedTypes}].",[h.SELECTOR_KIND_MISMATCH]:"Use a selector of the correct kind: [{selectorKinds}].",[h.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE]:"Either add 'selector' to expectedTypes or remove selectorKinds.",[h.KEYWORD_COLLISION]:"Give each command a unique keyword. Move the shared keyword to alternatives on one command, or use a more specific translation."};}}),Qe={};Yr(Qe,{SchemaErrorCodes:()=>h,formatValidationResults:()=>it,getValidationStats:()=>at,validateAllKeywordCollisions:()=>nt,validateAllSchemas:()=>tt,validateCommandSchema:()=>er,validateKeywordCollisions:()=>rr,validateRoleValues:()=>ut});function Xr(r,e){return {action:r,items:e}}function er(r){let e=[];for(let i of r.roles)i.expectedTypes.includes("literal")&&i.expectedTypes.includes("selector")&&(i.role==="patient"&&Ae.has(r.action)?e.push(B(h.MULTI_TYPE_PATIENT_EXPECTED,"note",{role:i.role,command:r.action},i.role)):e.push(B(h.AMBIGUOUS_TYPE_LITERAL_SELECTOR,"warning",{role:i.role},i.role))),i.expectedTypes.length>3&&!Ae.has(r.action)&&e.push(B(h.TOO_MANY_EXPECTED_TYPES,"warning",{role:i.role,count:i.expectedTypes.length},i.role));for(let i of r.roles)i.selectorKinds&&i.selectorKinds.length>0&&(i.expectedTypes.includes("selector")||e.push(B(h.SELECTOR_KINDS_WITHOUT_SELECTOR_TYPE,"warning",{role:i.role},i.role)));switch(r.action){case "transition":Zr(r,e);break;case "on":Qr(r,e);break;case "if":case "unless":et(r,e);break;case "repeat":case "for":case "while":rt(r,e);break}return r.roles.filter(i=>i.required).length===0&&(tr.has(r.action)?e.push(B(h.NO_REQUIRED_ROLES_EXPECTED,"note",{command:r.action})):e.push(B(h.NO_REQUIRED_ROLES,"warning",{}))),Xr(r.action,e)}function Zr(r,e){let t=r.roles.find(a=>a.role==="patient"),i=r.roles.find(a=>a.role==="goal");t&&t.expectedTypes.includes("selector")&&e.push(B(h.TRANSITION_PATIENT_ACCEPTS_SELECTOR,"warning",{},"patient")),t&&!i&&e.push(B(h.TRANSITION_MISSING_GOAL,"error",{}));}function Qr(r,e){let t=r.roles.find(i=>i.role==="event");t||e.push(B(h.EVENT_HANDLER_MISSING_EVENT,"warning",{})),t&&!t.required&&e.push(B(h.EVENT_HANDLER_EVENT_NOT_REQUIRED,"warning",{}));}function et(r,e){let t=r.roles.find(i=>i.role==="condition");t||e.push(B(h.CONDITIONAL_MISSING_CONDITION,"warning",{})),t&&!t.required&&e.push(B(h.CONDITIONAL_CONDITION_NOT_REQUIRED,"warning",{}));}function rt(r,e){r.action==="for"?r.roles.find(i=>i.role==="source")||e.push(B(h.FOR_LOOP_MISSING_SOURCE,"warning",{})):r.action==="while"&&(r.roles.find(i=>i.role==="condition")||e.push(B(h.WHILE_LOOP_MISSING_CONDITION,"warning",{})));}function tt(r,e={}){let t=new Map,{includeNotes:i=false}=e;for(let[a,u]of Object.entries(r)){let n=er(u),o=n.items.some(l=>l.severity==="warning"||l.severity==="error"),s=i&&n.items.some(l=>l.severity==="note");(o||s)&&t.set(a,n);}return t}function it(r,e={}){let t=[],{showNotes:i=false,showCodes:a=true}=e;for(let[u,n]of r){let o=n.items.filter(m=>m.severity==="error"),s=n.items.filter(m=>m.severity==="warning"),l=n.items.filter(m=>m.severity==="note");if(o.length>0){t.push(` \u274C ${u}:`);for(let m of o){let c=a?` [${m.code}]`:"";t.push(` ERROR${c}: ${m.message}`),m.suggestion&&t.push(` \u{1F4A1} Suggestion: ${m.suggestion}`);}}if(s.length>0){t.push(` \u26A0\uFE0F ${u}:`);for(let m of s){let c=a?` [${m.code}]`:"";t.push(` ${c?`${m.code}: `:""}${m.message}`),m.suggestion&&t.push(` \u{1F4A1} ${m.suggestion}`);}}if(i&&l.length>0){t.push(` \u2139\uFE0F ${u}:`);for(let m of l){let c=a?` [${m.code}]`:"";t.push(` ${c?`${m.code}: `:""}${m.message}`);}}}return t.join(`
2
+ `)}function at(r){let e=0,t=0,i=0,a={};for(let u of r.values())for(let n of u.items)n.severity==="error"?e++:n.severity==="warning"?t++:n.severity==="note"&&i++,a[n.code]=(a[n.code]||0)+1;return {totalCommands:r.size,errors:e,warnings:t,notes:i,byCode:a}}function ut(r,e){let t=[];for(let i of e){let a=r.roles.find(u=>u.role===i.role);a&&(a.expectedTypes.length>0&&!a.expectedTypes.includes(i.type)&&(a.expectedTypes.includes("expression")||t.push({level:"error",role:i.role,message:`${r.action}.${i.role} expects type [${a.expectedTypes.join(", ")}], got '${i.type}'`,code:h.VALUE_TYPE_MISMATCH})),i.type==="selector"&&i.selectorKind&&a.selectorKinds&&a.selectorKinds.length>0&&(a.selectorKinds.includes(i.selectorKind)||t.push({level:"error",role:i.role,message:`${r.action}.${i.role} expects selector kind [${a.selectorKinds.join(", ")}], got '${i.selectorKind}'`,code:h.SELECTOR_KIND_MISMATCH})));}return t}function rr(r){let e=[];if(!r.keywords)return {language:r.code,collisions:e};let t=new Map;for(let[a,u]of Object.entries(r.keywords)){if(!u||!u.primary)continue;let n=t.get(u.primary)||[];if(n.push({command:a,isPrimary:true}),t.set(u.primary,n),u.alternatives)for(let o of u.alternatives){let s=t.get(o)||[];s.push({command:a,isPrimary:false}),t.set(o,s);}}for(let[a,u]of t){let n=[...new Set(u.map(l=>l.command))];if(n.length<=1)continue;let o=u.filter(l=>l.isPrimary).length,s;o>=2?s="primary-primary":o===1?s="primary-alternative":s="alternative-alternative",e.push({keyword:a,commands:n.sort(),type:s});}let i={"primary-primary":0,"primary-alternative":1,"alternative-alternative":2};return e.sort((a,u)=>i[a.type]-i[u.type]),{language:r.code,collisions:e}}function nt(r){let e=[];for(let[,t]of Object.entries(r)){let i=rr(t);i.collisions.length>0&&e.push(i);}return e.sort((t,i)=>t.language.localeCompare(i.language))}var Ae,tr,ot=Je({"src/generators/schema-validator.ts"(){Jr(),Ae=new Set(["put","append","prepend","log","throw","make","measure","return","swap","morph","beep","copy"]),tr=new Set(["compound","else","halt","continue","async","init","settle","focus","blur","return","js","measure","break","exit","beep","empty","open","close","select","clear","reset","breakpoint"]);}});var j=new Map,R=new Map,ie=new Map,we=null;function ir(r,e){let t={...r};for(let i of Object.keys(e)){let a=e[i],u=r[i];a!==void 0&&(typeof a=="object"&&a!==null&&!Array.isArray(a)&&typeof u=="object"&&u!==null&&!Array.isArray(u)?t[i]=ir(u,a):t[i]=a);}return t}function st(r,e){return ir(r,e)}function De(r){if(!r.extends)return r;let e=R.get(r.extends);if(!e)return console.warn(`[Registry] Profile '${r.code}' extends '${r.extends}' but base is not registered. Make sure to import the base language before the variant.`),r;let t=De(e);return st(t,r)}function J(r,e,t){j.set(r,e),R.set(r,t),ie.delete(r);}function ar(r){we=r;}var je=new Map;function H(r){return r.split("-")[0]}function Y(r){return r.includes("-")}function lt(r){let e=j.get(r);if(!e&&Y(r)){let t=H(r);e=j.get(t);}if(!e){let t=Array.from(j.keys()).join(", ");throw new Error(`Language '${r}' is not registered. Registered languages: ${t||"none"}. Import the language module first: import '@lokascript/semantic/languages/${r}';`)}return e}function mt(r){let e=R.get(r);if(!e&&Y(r)){let t=H(r);e=R.get(t);}if(!e){let t=Array.from(R.keys()).join(", ");throw new Error(`Language profile '${r}' is not registered. Registered languages: ${t||"none"}. Import the language module first: import '@lokascript/semantic/languages/${r}';`)}return De(e)}function L(r){let e=R.get(r);return !e&&Y(r)&&(e=R.get(H(r))),e?De(e):void 0}function ct(){return Array.from(j.keys())}function ur(r){if(j.has(r)&&R.has(r))return true;if(Y(r)){let e=H(r);return j.has(e)&&R.has(e)}return false}function pt(r,e){return lt(e).tokenize(r)}function G(r){let e=ie.get(r);if(!e&&Y(r)&&(e=ie.get(H(r))),e)return e;let t=je.get(r);if(!t&&Y(r)&&(t=je.get(H(r))),t)return ie.set(r,t),t;if(!we)throw new Error(`No patterns registered for language '${r}'. Either import the language module or set a pattern generator.`);let i=mt(r),a=we(i);return ie.set(r,a),a}function ue(r){let e="complex";return r.startsWith("#")&&!r.includes(" ")?e="id":r.startsWith(".")&&!r.includes(" ")?e="class":r.startsWith("[")&&r.endsWith("]")?e="attribute":/^[a-z][a-z0-9]*$/i.test(r)&&(e="element"),{type:"selector",value:r,selectorKind:e}}function A(r,e){let t={type:"literal",value:r};return e!==void 0?{type:"literal",value:r,dataType:e}:t}function Le(r){return ke(r)}function I(r){return {type:"reference",value:r}}function Ce(r,e){return {type:"property-path",object:r,property:e}}function de(r,e,t){let i={kind:"command",action:r,roles:new Map(Object.entries(e))};return t!==void 0?{...i,metadata:t}:i}function $e(r,e,t,i,a,u){let n=new Map;n.set("event",r);let o={kind:"event-handler",action:"on",roles:n,body:e};return t!==void 0&&(o.eventModifiers=t),i!==void 0&&(o.metadata=i),o}function Ve(r,e="then",t){let i={kind:"compound",action:"compound",roles:new Map,statements:r,chainType:e};return t!==void 0&&(i.metadata=t),i}function qe(r,e){return !e||e.length===0||e.includes(r)||e.includes("expression")?true:r==="property-path"?e.some(t=>["selector","reference","expression"].includes(t)):false}function It(r,e){return r.possessive?.keywords?.[e]}var be=.8,jt=.6,Lt=.15,$t=.5,We=.15,Ue=.1,Ke=new Set(["\u0628\u062F\u0644","\u063A\u064A\u0631","\u0623\u0636\u0641","\u0623\u0632\u0644","\u0636\u0639","\u0627\u062C\u0639\u0644","\u0639\u064A\u0646","\u0632\u062F","\u0627\u0646\u0642\u0635","\u0633\u062C\u0644","\u0623\u0638\u0647\u0631","\u0623\u062E\u0641","\u0634\u063A\u0644","\u0623\u0631\u0633\u0644","\u0631\u0643\u0632","\u0634\u0648\u0634","\u062A\u0648\u0642\u0641","\u0627\u0646\u0633\u062E","\u0627\u062D\u0630\u0641","\u0627\u0635\u0646\u0639","\u0627\u0646\u062A\u0638\u0631","\u0627\u0646\u062A\u0642\u0627\u0644","\u0623\u0648"]),Vt={patient:["\u0639\u0644\u0649"],destination:["\u0625\u0644\u0649","\u0627\u0644\u0649"],source:["\u0645\u0646"],agent:["\u0645\u0646"],manner:["\u0628"],style:["\u0628"],goal:["\u0625\u0644\u0649","\u0627\u0644\u0649"],method:["\u0628"]},qt=class{calculate(r){return this.calculateWithBreakdown(r).final}calculateWithBreakdown(r){let e=this.scoreRoleCoverage(r),t=this.scoreStemPenalty(r),i=this.scoreLanguageBoost(r),a=this.scoreLanguageAdjustment(r),u=e;return u=Math.max($t,u+t),u=Math.min(1,u+i),u=Math.max(0,Math.min(1,u+a)),{roleCoverage:e,stemPenalty:t,languageBoost:i,languageAdjustment:a,final:u}}scoreRoleCoverage(r){let{pattern:e,captured:t}=r,i=0,a=0,u=n=>e.extraction?.[n]?.default!==void 0;for(let n of e.template.tokens)if(n.type==="role")a+=1,t.has(n.role)&&(i+=1);else if(n.type==="group")for(let o of n.tokens)o.type==="role"&&(a+=be,t.has(o.role)?i+=be:u(o.role)&&(i+=be*jt));return a>0?i/a:1}scoreStemPenalty(r){let{stemMatchCount:e,totalKeywordMatches:t}=r;return e<=0||t<=0?0:-(e/t)*Lt}scoreLanguageBoost(r){let{pattern:e}=r;if(e.language!=="ar")return 0;let t=e.template.tokens[0];return !t||t.type!=="literal"?0:Ke.has(t.value)||t.alternatives?.some(i=>Ke.has(i))?We:0}scoreLanguageAdjustment(r){let{pattern:e,captured:t}=r;if(e.language!=="ar")return 0;let i=0;for(let[a,u]of t.entries()){let n=Vt[a];if(!n||n.length===0)continue;let o="metadata"in u?u.metadata:void 0;o&&typeof o.prepositionValue=="string"&&(n.includes(o.prepositionValue)?i+=.1:i-=.1);}return Math.max(-Ue,Math.min(Ue,i))}},Wt=new qt,fe=class ae{constructor(e){this.matchCache=new Map,this.stemMatchCount=0,this.totalKeywordMatches=0,this.confidenceModel=e??Wt;}matchPattern(e,t){let i=e.mark(),a=new Map;if(this.currentProfile=L(t.language),this.stemMatchCount=0,this.totalKeywordMatches=0,!this.matchTokenSequence(e,t.template.tokens,a))return e.reset(i),null;let n=this.confidenceModel.calculate({pattern:t,captured:a,stemMatchCount:this.stemMatchCount,totalKeywordMatches:this.totalKeywordMatches});return this.applyExtractionRules(t,a),{pattern:t,captured:a,consumedTokens:e.position()-i.position,confidence:n}}matchBest(e,t){this.matchCache.clear();let i=[],a=e.position();for(let n of t){let o=e.mark(),s=`${a}:${n.id}`,l;this.matchCache.has(s)?l=this.matchCache.get(s):(l=this.matchPattern(e,n),this.matchCache.set(s,l)),l&&i.push(l),e.reset(o);}if(i.length===0)return null;i.sort((n,o)=>{let s=o.pattern.priority-n.pattern.priority;return s!==0?s:o.confidence-n.confidence});let u=i[0];return this.matchPattern(e,u.pattern),u}matchTokenSequence(e,t,i){let a=t[0],u=a?.type==="literal"&&(a.value==="and"||a.value==="then"||a.alternatives?.includes("and")||a.alternatives?.includes("then"));if(this.currentProfile?.code==="ar"&&!u)for(;e.peek()?.kind==="conjunction";)e.advance();for(let n of t)if(!this.matchPatternToken(e,n,i)){if(this.isOptional(n))continue;return false}return true}matchPatternToken(e,t,i){switch(t.type){case "literal":return this.matchLiteralToken(e,t);case "role":return this.matchRoleToken(e,t,i);case "group":return this.matchGroupToken(e,t,i);default:return false}}matchLiteralToken(e,t){let i=e.peek();if(!i)return false;let a=this.getMatchType(i,t.value);if(a!=="none")return this.totalKeywordMatches++,a==="stem"&&this.stemMatchCount++,e.advance(),true;if(t.alternatives)for(let u of t.alternatives){let n=this.getMatchType(i,u);if(n!=="none")return this.totalKeywordMatches++,n==="stem"&&this.stemMatchCount++,e.advance(),true}return false}matchRoleToken(e,t,i){this.skipNoiseWords(e);let a=e.peek();if(!a)return t.optional||false;let u=this.tryMatchPossessiveExpression(e);if(u)return t.expectedTypes&&t.expectedTypes.length>0&&!t.expectedTypes.includes(u.type)&&!t.expectedTypes.includes("expression")?t.optional||false:(i.set(t.role,u),true);let n=this.tryMatchMethodCallExpression(e);if(n)return t.expectedTypes&&t.expectedTypes.length>0&&!t.expectedTypes.includes(n.type)&&!t.expectedTypes.includes("expression")?t.optional||false:(i.set(t.role,n),true);let o=this.tryMatchPossessiveSelectorExpression(e);if(o)return t.expectedTypes&&t.expectedTypes.length>0&&!qe(o.type,t.expectedTypes)?t.optional||false:(i.set(t.role,o),true);let s=this.tryMatchPropertyAccessExpression(e);if(s)return t.expectedTypes&&t.expectedTypes.length>0&&!t.expectedTypes.includes(s.type)&&!t.expectedTypes.includes("expression")?t.optional||false:(i.set(t.role,s),true);let l=this.tryMatchSelectorPropertyExpression(e);if(l)return t.expectedTypes&&t.expectedTypes.length>0&&!qe(l.type,t.expectedTypes)?t.optional||false:(i.set(t.role,l),true);let m=this.tokenToSemanticValue(a);return !m||t.expectedTypes&&t.expectedTypes.length>0&&!t.expectedTypes.includes(m.type)?t.optional||false:(i.set(t.role,m),e.advance(),true)}tryMatchPossessiveExpression(e){let t=e.peek();if(!t||!this.currentProfile)return null;let i=(t.normalized||t.value).toLowerCase(),a=It(this.currentProfile,i);if(!a)return null;let u=e.mark();e.advance();let n=e.peek();if(!n)return e.reset(u),null;if(n.kind==="identifier"||n.kind==="keyword"&&!this.isStructuralKeyword(n.value)||n.kind==="selector"&&n.value.startsWith("*")||n.kind==="selector"&&n.value.startsWith("@")||n.kind==="selector"&&n.value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(n.value)){e.advance();let o=n.value;n.kind==="selector"&&o.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(o)&&(o=o.substring(1));let s=o;for(;e.peek()?.kind==="selector"&&e.peek().value.startsWith(".")&&/^\.[a-zA-Z_]\w*/.test(e.peek().value);)s+=e.peek().value,e.advance();let l=e.peek();return l?.kind==="literal"&&l.value.startsWith("(")&&(s+=l.value,e.advance()),Ce(I(a),s)}return e.reset(u),null}isStructuralKeyword(e){return new Set(["into","in","to","from","at","by","with","without","before","after","of","as","on","then","end","else","if","repeat","while","for","toggle","add","remove","put","set","show","hide","increment","decrement","send","trigger","call"]).has(e.toLowerCase())}tryMatchMethodCallExpression(e){let t=e.peek();if(!t||t.kind!=="selector")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="operator"||a.value!==".")return e.reset(i),null;e.advance();let u=e.peek();if(!u||u.kind!=="identifier")return e.reset(i),null;e.advance();let n=e.peek();if(!n||n.kind!=="punctuation"||n.value!=="(")return e.reset(i),null;e.advance();let o=[];for(;!e.isAtEnd()&&o.length<ae.MAX_METHOD_ARGS;){let l=e.peek();if(!l)break;if(l.kind==="punctuation"&&l.value===")"){e.advance();break}if(l.kind==="punctuation"&&l.value===","){e.advance();continue}o.push(l.value),e.advance();}return {type:"expression",raw:`${t.value}.${u.value}(${o.join(", ")})`}}tryMatchPropertyAccessExpression(e){let t=e.peek();if(!t||t.kind!=="identifier"&&t.kind!=="keyword")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="operator"||a.value!==".")return e.reset(i),null;e.advance();let u=e.peek();if(!u||u.kind!=="identifier")return e.reset(i),null;e.advance();let n=`${t.value}.${u.value}`,o=1;for(;!e.isAtEnd()&&o<ae.MAX_PROPERTY_DEPTH;){let l=e.peek();if(!l||l.kind!=="operator"||l.value!==".")break;e.advance();let m=e.peek();if(!m||m.kind!=="identifier")break;e.advance(),n+=`.${m.value}`,o++;}let s=e.peek();if(s&&s.kind==="punctuation"&&s.value==="("){e.advance();let l=[],m=0;for(;!e.isAtEnd()&&l.length<ae.MAX_METHOD_ARGS;){let p=e.peek();if(!p)break;if(p.kind==="punctuation"&&p.value===")"){if(m===0){e.advance();break}m--;}if(p.kind==="punctuation"&&p.value==="("&&m++,p.kind==="punctuation"&&p.value===","){e.advance();continue}l.push(p.value),e.advance();}return {type:"expression",raw:`${n}(${l.join(", ")})`}}return {type:"expression",raw:n}}tryMatchPossessiveSelectorExpression(e){let t=e.peek();if(!t||t.kind!=="selector")return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="punctuation"||a.value!=="'s")return e.reset(i),null;e.advance();let u=e.peek();return !u||u.kind!=="selector"&&u.kind!=="identifier"?(e.reset(i),null):(e.advance(),Ce(ue(t.value),u.value))}tryMatchSelectorPropertyExpression(e){let t=e.peek();if(!t||t.kind!=="selector"||!t.value.startsWith("#"))return null;let i=e.mark();e.advance();let a=e.peek();if(!a||a.kind!=="selector"||!a.value.startsWith("."))return e.reset(i),null;let u=e.peek(1);u&&u.kind,e.advance();let n=a.value.slice(1);return Ce(ue(t.value),n)}matchGroupToken(e,t,i){let a=e.mark(),u=new Set(i.keys());if(!this.matchTokenSequence(e,t.tokens,i)){e.reset(a);for(let o of i.keys())u.has(o)||i.delete(o);return t.optional||false}return true}getMatchType(e,t){return e.value===t?"exact":e.normalized===t?"normalized":e.stem===t&&e.stemConfidence!==void 0&&e.stemConfidence>=.7?"stem":e.kind==="keyword"&&e.value.toLowerCase()===t.toLowerCase()?"case-insensitive":"none"}tokenToSemanticValue(e){switch(e.kind){case "selector":return ue(e.value);case "literal":return this.parseLiteralValue(e.value);case "keyword":let t=(e.normalized||e.value).toLowerCase();return Le(t)?I(t):A(e.normalized||e.value);case "identifier":if(e.value.startsWith(":"))return I(e.value);let i=e.value.toLowerCase();return Le(i)?I(i):{type:"expression",raw:e.value};case "url":return A(e.value,"string");default:return null}}parseLiteralValue(e){if(e.startsWith('"')||e.startsWith("'")||e.startsWith("`")||e.startsWith("\u300C")){let a=e.slice(1,-1);return A(a,"string")}if(e==="true")return A(true,"boolean");if(e==="false")return A(false,"boolean");let t=e.match(/^(\d+(?:\.\d+)?)(ms|s|m|h)?$/);if(t){let a=parseFloat(t[1]);return t[2]?A(e,"duration"):A(a,"number")}let i=parseFloat(e);return isNaN(i)?A(e,"string"):A(i,"number")}applyExtractionRules(e,t){for(let[i,a]of Object.entries(e.extraction))t.has(i)||(a.value!==void 0?t.set(i,{type:"literal",value:a.value}):a.default&&t.set(i,a.default));}isOptional(e){return e.type!=="literal"&&e.optional===true}skipNoiseWords(e){let t=e.peek();if(!t)return;let i=t.value.toLowerCase();if(ae.ENGLISH_NOISE_WORDS.has(i)){let a=e.mark();e.advance();let u=e.peek();if(u&&(u.kind==="selector"||u.kind==="identifier"))return;e.reset(a);}i==="class"&&e.advance();}extractEventModifiers(e){let t={},i=false;for(;!e.isAtEnd();){let a=e.peek();if(!a||a.kind!=="event-modifier")break;let u=a.metadata;if(!u)break;switch(i=true,u.modifierName){case "once":t.once=true;break;case "debounce":typeof u.value=="number"&&(t.debounce=u.value);break;case "throttle":typeof u.value=="number"&&(t.throttle=u.value);break;case "queue":(u.value==="first"||u.value==="last"||u.value==="all"||u.value==="none")&&(t.queue=u.value);break}e.advance();}return i?t:void 0}};fe.MAX_PROPERTY_DEPTH=10;fe.MAX_METHOD_ARGS=20;fe.ENGLISH_NOISE_WORDS=new Set(["the","a","an"]);var Ut=fe,O=new Ut;function ne(r,e){return pt(r,e)}function nr(){return ct()}var Kt={ko:{\uD074\uB9AD:"click",\uC785\uB825:"input",\uBCC0\uACBD:"change",\uC81C\uCD9C:"submit",\uD0A4\uB2E4\uC6B4:"keydown",\uD0A4\uC5C5:"keyup",\uB9C8\uC6B0\uC2A4\uC624\uBC84:"mouseover",\uB9C8\uC6B0\uC2A4\uC544\uC6C3:"mouseout",\uB9C8\uC6B0\uC2A4\uB2E4\uC6B4:"mousedown",\uB9C8\uC6B0\uC2A4\uC5C5:"mouseup",\uD3EC\uCEE4\uC2A4:"focus",\uBE14\uB7EC:"blur",\uB85C\uB4DC:"load",\uB9AC\uC0AC\uC774\uC988:"resize",\uC2A4\uD06C\uB864:"scroll"},ja:{\u30AF\u30EA\u30C3\u30AF:"click",\u5165\u529B:"input",\u5909\u66F4:"change",\u9001\u4FE1:"submit",\u30AD\u30FC\u30C0\u30A6\u30F3:"keydown",\u30AD\u30FC\u30A2\u30C3\u30D7:"keyup",\u30AD\u30FC\u30D7\u30EC\u30B9:"keypress",\u30DE\u30A6\u30B9\u30AA\u30FC\u30D0\u30FC:"mouseover",\u30DE\u30A6\u30B9\u30A2\u30A6\u30C8:"mouseout",\u30DE\u30A6\u30B9\u62BC\u4E0B:"mousedown",\u30DE\u30A6\u30B9\u89E3\u653E:"mouseup",\u30D5\u30A9\u30FC\u30AB\u30B9:"focus",\u30D6\u30E9\u30FC:"blur",\u30ED\u30FC\u30C9:"load",\u8AAD\u307F\u8FBC\u307F:"load",\u30B5\u30A4\u30BA\u5909\u66F4:"resize",\u30B9\u30AF\u30ED\u30FC\u30EB:"scroll"},ar:{\u0627\u0644\u0646\u0642\u0631:"click",\u0646\u0642\u0631:"click",\u0627\u0644\u0625\u062F\u062E\u0627\u0644:"input",\u0625\u062F\u062E\u0627\u0644:"input",\u0627\u0644\u062A\u063A\u064A\u064A\u0631:"change",\u062A\u063A\u064A\u064A\u0631:"change",\u0627\u0644\u0625\u0631\u0633\u0627\u0644:"submit",\u0625\u0631\u0633\u0627\u0644:"submit","\u0636\u063A\u0637 \u0627\u0644\u0645\u0641\u062A\u0627\u062D":"keydown","\u0631\u0641\u0639 \u0627\u0644\u0645\u0641\u062A\u0627\u062D":"keyup","\u062A\u0645\u0631\u064A\u0631 \u0627\u0644\u0645\u0627\u0648\u0633":"mouseover",\u0627\u0644\u062A\u0631\u0643\u064A\u0632:"focus",\u062A\u062D\u0645\u064A\u0644:"load",\u062A\u0645\u0631\u064A\u0631:"scroll"},es:{clic:"click",click:"click",entrada:"input",cambio:"change",env\u00EDo:"submit",enviar:"submit","tecla abajo":"keydown","tecla arriba":"keyup","rat\xF3n encima":"mouseover","rat\xF3n fuera":"mouseout",enfoque:"focus",desenfoque:"blur",carga:"load",desplazamiento:"scroll"},tr:{t\u0131klama:"click",t\u0131kla:"click",t\u0131k:"click",giri\u015F:"input",girdi:"input",de\u011Fi\u015Fiklik:"change",de\u011Fi\u015Fim:"change",g\u00F6nderme:"submit",g\u00F6nder:"submit",tu\u015Fbasma:"keydown",tu\u015Fb\u0131rakma:"keyup",fare_bas:"mousedown",fare_b\u0131rak:"mouseup",farei\u00E7inde:"mouseover",fared\u0131\u015F\u0131nda:"mouseout",odaklanma:"focus",odak:"focus",bulan\u0131kl\u0131k:"blur",y\u00FCkleme:"load",y\u00FCkle:"load",boyut_de\u011Fi\u015Ftir:"resize",kayd\u0131rma:"scroll"},pt:{clique:"click",clicar:"click",click:"click",entrada:"input",inserir:"input",mudan\u00E7a:"change",mudanca:"change",alterar:"change",envio:"submit",enviar:"submit","tecla baixo":"keydown","tecla cima":"keyup","pressionar tecla":"keydown","soltar tecla":"keyup","mouse sobre":"mouseover","mouse fora":"mouseout",foco:"focus",focar:"focus",desfoque:"blur",desfocar:"blur",carregar:"load",carregamento:"load",rolagem:"scroll",rolar:"scroll"},zh:{\u70B9\u51FB:"click",\u5355\u51FB:"click",\u53CC\u51FB:"dblclick",\u8F93\u5165:"input",\u6539\u53D8:"change",\u53D8\u5316:"change",\u53D8\u66F4:"change",\u63D0\u4EA4:"submit",\u53D1\u9001:"submit",\u6309\u952E:"keydown",\u952E\u5165:"keydown",\u677E\u952E:"keyup",\u9F20\u6807\u8FDB\u5165:"mouseover",\u9F20\u6807\u79FB\u5165:"mouseover",\u9F20\u6807\u79BB\u5F00:"mouseout",\u9F20\u6807\u79FB\u51FA:"mouseout",\u7126\u70B9:"focus",\u805A\u7126:"focus",\u5931\u7126:"blur",\u6A21\u7CCA:"blur",\u52A0\u8F7D:"load",\u8F7D\u5165:"load",\u6EDA\u52A8:"scroll"},fr:{clic:"click",cliquer:"click",click:"click",saisie:"input",entr\u00E9e:"input",changement:"change",changer:"change",soumettre:"submit",soumission:"submit",envoi:"submit","touche bas":"keydown","touche haut":"keyup","souris dessus":"mouseover","souris dehors":"mouseout",focus:"focus",focaliser:"focus",d\u00E9focus:"blur",d\u00E9focaliser:"blur",chargement:"load",charger:"load",d\u00E9filement:"scroll",d\u00E9filer:"scroll"},de:{klick:"click",klicken:"click",click:"click",eingabe:"input",eingeben:"input",\u00E4nderung:"change",\u00E4ndern:"change",absenden:"submit",einreichen:"submit","taste runter":"keydown","taste hoch":"keyup","maus \xFCber":"mouseover","maus raus":"mouseout",fokus:"focus",fokussieren:"focus",defokussieren:"blur",unsch\u00E4rfe:"blur",laden:"load",ladung:"load",scrollen:"scroll",bl\u00E4ttern:"scroll"},id:{klik:"click",click:"click",masukan:"input",input:"input",ubah:"change",perubahan:"change",kirim:"submit","tekan tombol":"keydown","lepas tombol":"keyup","mouse masuk":"mouseover","mouse keluar":"mouseout",fokus:"focus",blur:"blur",muat:"load",memuat:"load",gulir:"scroll",menggulir:"scroll"},bn:{\u0995\u09CD\u09B2\u09BF\u0995:"click",\u0987\u09A8\u09AA\u09C1\u099F:"input",\u099C\u09AE\u09BE:"submit",\u09B2\u09CB\u09A1:"load",\u09B8\u09CD\u0995\u09CD\u09B0\u09CB\u09B2:"scroll",\u09B0\u09BF\u09B8\u09BE\u0987\u099C:"resize",\u099D\u09BE\u09AA\u09B8\u09BE:"blur",\u09AB\u09CB\u0995\u09BE\u09B8:"focus",\u09AA\u09B0\u09BF\u09AC\u09B0\u09CD\u09A4\u09A8:"change"},qu:{click:"click","\xF1it'iy":"click",\u00F1itiy:"click",yaykuchiy:"input",yaykuy:"input",tikray:"change","t'ikray":"change",apachiy:"submit",kachay:"submit","llave uray":"keydown","llave hawa":"keyup","q'away":"focus",qhaway:"focus",paqariy:"blur","mana q'away":"blur",cargay:"load",apakuy:"load",apamuy:"load",kunray:"scroll",muyuy:"scroll",hatun_kay:"resize"},sw:{bofya:"click",click:"click",kubofya:"click",ingiza:"input",kubadilisha:"change",mabadiliko:"change",tuma:"submit",kutuma:"submit","bonyeza chini":"keydown","bonyeza juu":"keyup","panya juu":"mouseover","panya nje":"mouseout",lenga:"focus",kulenga:"focus",blur:"blur",pakia:"load",kupakia:"load",sogeza:"scroll",kusogeza:"scroll"}};var Ht={action:"toggle",description:"Toggle a class or attribute on/off",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to toggle",required:true,expectedTypes:["selector"],selectorKinds:["class","attribute"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES","INVALID_CSS_PROPERTY"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"toggle command requires an argument"},{condition:"Class names are valid CSS identifiers",errorCode:"NO_VALID_CLASS_NAMES",message:"toggle command: no valid class names found"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to toggle",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers",INVALID_CSS_PROPERTY:"Check CSS property name syntax (use kebab-case)"}},Yt={action:"add",description:"Add a class or attribute to an element",category:"dom-class",primaryRole:"patient",roles:[{role:"patient",description:"The class or attribute to add",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES","PROPERTY_REQUIRES_VALUE"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"add command requires an argument"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to add",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers",PROPERTY_REQUIRES_VALUE:"When adding a property (*prop), provide a value argument"}},Jt={action:"remove",description:"Remove a class or attribute from an element",category:"dom-class",primaryRole:"patient",targetRole:"source",roles:[{role:"patient",description:"The class or attribute to remove",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to remove from (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}],errorCodes:["MISSING_ARGUMENT","NO_VALID_CLASS_NAMES"],preconditions:[{condition:"Command has at least one argument",errorCode:"MISSING_ARGUMENT",message:"remove command requires an argument"}],recoveryHints:{MISSING_ARGUMENT:"Add a class selector (.classname) or attribute to remove",NO_VALID_CLASS_NAMES:"Ensure class names start with a dot (.) and are valid CSS identifiers"}},Xt={action:"put",description:"Put content into a target element or variable",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to put",required:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"destination",description:"Where to put the content",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"into"},markerVariants:{en:["before","after"]},methodCarrier:"method"}],errorCodes:["MISSING_ARGUMENTS","MISSING_CONTENT","MISSING_POSITION","INVALID_POSITION","NO_TARGET","NO_ELEMENTS"],preconditions:[{condition:"Command has content and position arguments",errorCode:"MISSING_ARGUMENTS",message:"put requires arguments"},{condition:"Content to put is specified",errorCode:"MISSING_CONTENT",message:"put requires content"},{condition:"Position keyword is specified (into, before, after, etc.)",errorCode:"MISSING_POSITION",message:"put requires position keyword"}],recoveryHints:{MISSING_ARGUMENTS:"Use syntax: put <content> into/before/after <target>",MISSING_CONTENT:"Add content to put (string, element, or expression)",MISSING_POSITION:"Add position keyword: into, before, after, at start of, at end of",INVALID_POSITION:"Valid positions: into, before, after, at start of, at end of",NO_TARGET:'Ensure target element exists or use "me" reference',NO_ELEMENTS:"Check that the selector matches existing elements"}},Zt={action:"set",description:"Set a property or variable to a value",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The property or variable to set",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ja:"\u3092",ko:"\uB97C",tr:"i",ar:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The value to set",required:true,expectedTypes:["literal","expression","reference"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",es:"a",pt:"para",fr:"\xE0",de:"auf",id:"ke",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",ar:"\u0625\u0644\u0649",sw:"kwenye",tl:"sa",bn:"\u09A4\u09C7",qu:"man"}}],errorCodes:["MISSING_TARGET","INVALID_TARGET","MISSING_VALUE","INVALID_SYNTAX"],preconditions:[{condition:"Command has a target variable or property",errorCode:"MISSING_TARGET",message:"set command requires a target"},{condition:"Target is a valid variable or property reference",errorCode:"INVALID_TARGET",message:"set command target must be a string or object literal"},{condition:'Value is specified with "to" keyword',errorCode:"MISSING_VALUE",message:'set command requires a value (use "to" keyword)'}],recoveryHints:{MISSING_TARGET:"Add a target: set :variable to value OR set element.property to value",INVALID_TARGET:'Use local variable (:name), element property (el.prop), or "the X of Y" syntax',MISSING_VALUE:'Add "to <value>" to specify what to set',INVALID_SYNTAX:"Use syntax: set <target> to <value>"}},Qt={action:"show",description:"Make an element visible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to show",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},ei={action:"hide",description:"Make an element invisible",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The element to hide",required:true,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1},{role:"style",description:"Animation style (fade, slide, etc.)",required:false,expectedTypes:["literal"],svoPosition:2,sovPosition:2}]},ri={action:"on",description:"Handle an event",category:"event",primaryRole:"event",hasBody:true,roles:[{role:"event",description:"The event to handle",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to listen on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},ti={action:"trigger",description:"Trigger/dispatch an event",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to trigger (supports namespaced events like draggable:start)",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},ii={action:"wait",description:"Wait for a duration or event",category:"async",primaryRole:"duration",roles:[{role:"duration",description:"Duration or event to wait for",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},ai={action:"fetch",description:"Fetch data from a URL",category:"async",primaryRole:"source",roles:[{role:"source",description:"The URL to fetch from",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,renderOverride:{en:""}},{role:"responseType",description:"Response format (json, text, html, blob, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2,markerOverride:{en:"as"}},{role:"method",description:"HTTP method (GET, POST, etc.)",required:false,expectedTypes:["literal"],svoPosition:3,sovPosition:3},{role:"destination",description:"Where to store the result",required:false,expectedTypes:["selector","reference"],svoPosition:4,sovPosition:4}]},ui={action:"increment",description:"Increment a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to increment",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to increment by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},ni={action:"decrement",description:"Decrement a numeric value",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to decrement",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:1},{role:"quantity",description:"Amount to decrement by (defaults to 1)",required:false,expectedTypes:["literal"],default:{type:"literal",value:1,dataType:"number"},svoPosition:2,sovPosition:2,markerOverride:{en:"by"}}]},oi={action:"append",description:"Append content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to append",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to append to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},si={action:"prepend",description:"Prepend content to an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The content to prepend",required:true,expectedTypes:["literal","selector","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The element to prepend to",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"to"}}]},li={action:"log",description:"Log a value to the console",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The value to log",required:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},mi={action:"get",description:"Get a value from a source",category:"variable",primaryRole:"source",roles:[{role:"source",description:"The source to get from",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2,markerOverride:{en:"",es:"",pt:"",fr:"",de:"",ja:"\u3092",zh:"",ko:"\uB97C",ar:"\u0639\u0644\u0649",tr:"i",id:"",sw:"",tl:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"destination",description:"Where to store the result (optional)",required:false,expectedTypes:["reference"],svoPosition:2,sovPosition:1}]},ci={action:"take",description:"Take content from a source element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The class or element to take",required:true,expectedTypes:["selector"],svoPosition:1,sovPosition:2},{role:"source",description:"The element to take from (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},pi={action:"make",description:"Create a new element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element type or selector to create",required:true,expectedTypes:["literal","selector"],svoPosition:1,sovPosition:1}]},di={action:"halt",description:"Halt/stop execution or event propagation",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"What to halt (event, default, bubbling, etc.)",required:false,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},yi={action:"settle",description:"Wait for animations/transitions to settle",category:"async",primaryRole:"patient",roles:[{role:"patient",description:"The element to settle (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},fi={action:"throw",description:"Throw an error",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The error message or object to throw",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1}]},hi={action:"send",description:"Send an event to an element",category:"event",primaryRole:"event",roles:[{role:"event",description:"The event to send",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1,markerOverride:{en:"to",ja:"\u306B",ar:"\u0625\u0644\u0649",es:"a",ko:"\uC5D0\uAC8C",zh:"\u5230",tr:"-e",pt:"para",fr:"\xE0",de:"an",id:"ke",qu:"-man",sw:"kwa"}}]},vi={action:"if",description:"Conditional execution",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},Ei={action:"unless",description:"Negated conditional execution (executes when condition is false)",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to evaluate (body executes when false)",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},gi={action:"else",description:"Else branch of conditional",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},zi={action:"repeat",description:"Repeat a block of commands",category:"control-flow",primaryRole:"loopType",hasBody:true,roles:[{role:"loopType",description:"Loop variant: forever, times, for, while, until, until-event",required:true,expectedTypes:["literal"],svoPosition:0,sovPosition:0},{role:"quantity",description:"Number of times to repeat",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"event",description:"Event to wait for (terminates loop)",required:false,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2},{role:"source",description:"Element to listen for event on",required:false,expectedTypes:["selector","reference"],svoPosition:3,sovPosition:3}],notes:'Can also use "repeat forever", "repeat until condition", or "repeat until event X from Y"'},ki={action:"for",description:"Iterate over a collection",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The iteration variable",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:2},{role:"source",description:"The collection to iterate over",required:true,expectedTypes:["selector","reference","expression"],svoPosition:2,sovPosition:1,markerOverride:{en:"in"}}]},Ci={action:"while",description:"Loop while condition is true",category:"control-flow",primaryRole:"condition",hasBody:true,roles:[{role:"condition",description:"The condition to check",required:true,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},bi={action:"continue",description:"Continue to next loop iteration",category:"control-flow",primaryRole:"patient",roles:[]},Ai={action:"go",description:"Navigate to a URL",category:"navigation",primaryRole:"destination",roles:[{role:"destination",description:"The URL to navigate to",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"to"},renderOverride:{en:""}}]},wi={action:"transition",description:"Transition an element with animation",category:"dom-visibility",primaryRole:"patient",roles:[{role:"patient",description:"The property to transition (opacity, *background-color, etc.)",required:true,expectedTypes:["literal"],svoPosition:1,sovPosition:2,markerOverride:{en:"",ar:"",tl:"",sw:""}},{role:"goal",description:"The target value to transition to",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:3,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man",es:"a",pt:"para",fr:"\xE0",de:"auf",ja:"\u306B",ko:"\uC73C\uB85C",tr:"e",id:"ke"}},{role:"destination",description:"The target element (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:3,sovPosition:1},{role:"duration",description:"Transition duration (over 500ms, for 2 seconds)",required:false,expectedTypes:["literal"],svoPosition:4,sovPosition:4,markerOverride:{en:"over"}},{role:"style",description:"Easing function (ease-in, linear, etc.)",required:false,expectedTypes:["literal"],svoPosition:5,sovPosition:5}]},Di={action:"clone",description:"Clone an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to clone",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:2},{role:"destination",description:"Where to put the clone",required:false,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"into"}}]},xi={action:"focus",description:"Focus an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to focus (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Bi={action:"blur",description:"Remove focus from an element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to blur (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Fi={action:"empty",description:"Remove all children from an element (sets innerHTML to empty)",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to empty (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Si={action:"open",description:"Open a dialog, details element, or popover",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to open (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:2},{role:"style",description:"Open-mode variant (modal / non-modal) for <dialog>",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:{en:"as"}}]},Ti={action:"close",description:"Close a dialog, details element, or popover",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element to close (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Pi={action:"select",description:"Select the contents of a text field or DOM element",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The element whose contents to select (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Ri={action:"clear",description:"Clear a variable, local, or input element",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The variable or element to clear (defaults to me)",required:false,expectedTypes:["selector","reference","expression"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},Ni={action:"reset",description:"Reset a <form> element to its default values",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The form element to reset (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:1,sovPosition:1}]},_i={action:"breakpoint",description:"Drop into the debugger",category:"control-flow",primaryRole:"patient",roles:[]},Oi={action:"call",description:"Call a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The function to call",required:true,expectedTypes:["expression","reference"],svoPosition:1,sovPosition:1}]},Mi={action:"return",description:"Return a value from a function",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The value to return",required:false,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1}]},Ii={action:"js",description:"Execute raw JavaScript code",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The JavaScript code to execute",required:false,expectedTypes:["expression"],svoPosition:1,sovPosition:1}]},ji={action:"async",description:"Execute commands asynchronously",category:"async",primaryRole:"patient",hasBody:true,roles:[]},Li={action:"tell",description:"Execute commands in context of another element",category:"control-flow",primaryRole:"destination",hasBody:true,roles:[{role:"destination",description:"The element to tell",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}}]},$i={action:"default",description:"Set a default value for a variable",category:"variable",primaryRole:"destination",roles:[{role:"destination",description:"The variable to set default for",required:true,expectedTypes:["reference"],svoPosition:1,sovPosition:1,markerOverride:{en:"",ar:"",tl:"",sw:"",bn:"\u0995\u09C7",qu:"ta"}},{role:"patient",description:"The default value",required:true,expectedTypes:["literal","expression"],svoPosition:2,sovPosition:2,markerOverride:{en:"to",ar:"\u0625\u0644\u0649",tl:"sa",sw:"kwenye",bn:"\u09A4\u09C7",qu:"man"}}]},Vi={action:"init",description:"Initialization block that runs once",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[]},qi={action:"behavior",description:"Define a reusable behavior",category:"control-flow",primaryRole:"patient",hasBody:true,roles:[{role:"patient",description:"The behavior name (PascalCase identifier)",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1}]},Wi={action:"install",description:"Install a behavior on an element",category:"control-flow",primaryRole:"patient",roles:[{role:"patient",description:"The behavior name to install",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:2},{role:"destination",description:"Element to install on (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:1}]},Ui={action:"measure",description:"Measure element dimensions (x, y, width, height, etc.)",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"Property to measure (x, y, width, height, top, left, etc.)",required:false,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1},{role:"source",description:"Element to measure (defaults to me)",required:false,expectedTypes:["selector","reference"],default:{type:"reference",value:"me"},svoPosition:2,sovPosition:2,markerOverride:{en:"of"}}]},Ki={action:"swap",description:"Swap DOM content using various strategies (innerHTML, outerHTML, delete, etc.)",category:"dom-content",primaryRole:"destination",roles:[{role:"method",description:"The swap strategy (innerHTML, outerHTML, beforebegin, afterend, delete)",required:false,expectedTypes:["literal"],svoPosition:1,sovPosition:3,markerOverride:{en:""}},{role:"destination",description:"The element to swap content in/for",required:true,expectedTypes:["selector","reference"],svoPosition:2,sovPosition:1,markerOverride:{en:"of"}},{role:"patient",description:"The content to swap in (optional for delete)",required:false,expectedTypes:["literal","expression","selector"],svoPosition:3,sovPosition:2,markerOverride:{en:"with"}}]},Gi={action:"morph",description:"Morph an element into another using DOM diffing",category:"dom-content",primaryRole:"destination",roles:[{role:"destination",description:"The element to morph",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:""}},{role:"patient",description:"The target content/element to morph into",required:true,expectedTypes:["literal","expression","selector"],svoPosition:2,sovPosition:2,markerOverride:{en:"to"}}]},Hi={action:"beep",description:"Debug output for expressions with type information",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The expression(s) to debug",required:false,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Yi={action:"break",description:"Exit from the current loop",category:"control-flow",primaryRole:"patient",roles:[]},Ji={action:"copy",description:"Copy text or element content to the clipboard",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The text or element to copy",required:true,expectedTypes:["literal","selector","reference","expression"],svoPosition:1,sovPosition:1}]},Xi={action:"exit",description:"Exit from the current event handler",category:"control-flow",primaryRole:"patient",roles:[]},Zi={action:"pick",description:"Select a random element from a collection",category:"variable",primaryRole:"patient",roles:[{role:"patient",description:"The items to pick from",required:true,expectedTypes:["literal","expression","reference"],svoPosition:1,sovPosition:1},{role:"source",description:'The array to pick from (with "from" keyword)',required:false,expectedTypes:["reference","expression"],svoPosition:2,sovPosition:2}]},Qi={action:"scroll",description:"Scroll the viewport to a target element",category:"navigation",primaryRole:"destination",argSkipTokens:["of","the","top","bottom","middle","center","nearest","left","right","smoothly","instantly"],roles:[{role:"destination",description:"The element to scroll to",required:true,expectedTypes:["selector","reference"],svoPosition:1,sovPosition:1,markerOverride:{en:"to"}}]},or={en:"url",es:"url",pt:"url",fr:"url",de:"url",it:"url",ja:"url",ko:"url",zh:"url",ar:"url",he:"url",hi:"url",bn:"url",tr:"url",ru:"url",uk:"url",pl:"url",id:"url",vi:"url",th:"url",ms:"url",tl:"url",sw:"url",qu:"url"},ea={en:"partials in",es:"partials in",pt:"partials in",fr:"partials in",de:"partials in",it:"partials in",ja:"partials in",ko:"partials in",zh:"partials in",ar:"partials in",he:"partials in",hi:"partials in",bn:"partials in",tr:"partials in",ru:"partials in",uk:"partials in",pl:"partials in",id:"partials in",vi:"partials in",th:"partials in",ms:"partials in",tl:"partials in",sw:"partials in",qu:"partials in"},ra={action:"push",description:"Push a URL onto the browser history",category:"navigation",primaryRole:"patient",roles:[{role:"patient",description:"The URL to push (after the `url` keyword)",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:or}]},ta={action:"replace",description:"Replace the current browser history entry with a URL",category:"navigation",primaryRole:"patient",roles:[{role:"patient",description:"The URL to replace with (after the `url` keyword)",required:true,expectedTypes:["literal","expression"],svoPosition:1,sovPosition:1,markerOverride:or}]},ia={action:"process",description:"Process hx-partial markup in HTML content",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The HTML content (string, element, or response) to process",required:true,expectedTypes:["literal","reference","expression"],svoPosition:1,sovPosition:1,markerOverride:ea}]},aa={action:"render",description:"Render a template with optional variables",category:"dom-content",primaryRole:"patient",roles:[{role:"patient",description:"The template to render",required:true,expectedTypes:["selector","reference","expression"],svoPosition:1,sovPosition:2},{role:"style",description:"Variables to pass to the template (with keyword)",required:false,expectedTypes:["expression","reference"],svoPosition:2,sovPosition:1}]},sr={toggle:Ht,add:Yt,remove:Jt,put:Xt,set:Zt,show:Qt,hide:ei,on:ri,trigger:ti,wait:ii,fetch:ai,increment:ui,decrement:ni,append:oi,prepend:si,log:li,get:mi,take:ci,make:pi,halt:di,settle:yi,throw:fi,send:hi,if:vi,unless:Ei,else:gi,repeat:zi,for:ki,while:Ci,continue:bi,go:Ai,scroll:Qi,push:ra,replace:ta,process:ia,transition:wi,clone:Di,focus:xi,blur:Bi,empty:Fi,open:Si,close:Ti,select:Pi,clear:Ri,reset:Ni,breakpoint:_i,call:Oi,return:Mi,js:Ii,async:ji,tell:Li,default:$i,init:Vi,behavior:qi,install:Wi,measure:Ui,swap:Ki,morph:Gi,beep:Hi,break:Yi,copy:Ji,exit:Xi,pick:Zi,render:aa,compound:{action:"compound",description:"A compound node representing chained statements",primaryRole:"patient",category:"control-flow",hasBody:true,roles:[]}};function ua(){return Object.values(sr).filter(r=>r.roles.length>0)}typeof process<"u"&&process.env.NODE_ENV!=="production"&&Promise.resolve().then(()=>(ot(),Qe)).then(({validateAllSchemas:r,formatValidationResults:e})=>{let t=r(sr);t.size>0&&(console.warn("[SCHEMA VALIDATION] Found issues in command schemas:"),console.warn(e(t)),console.warn(`
3
+ These warnings help identify potential schema design issues.`),console.warn("Fix them to improve type inference and avoid runtime bugs."));}).catch(r=>{console.debug("Schema validation skipped:",r);});var Ge=class extends Error{constructor(r,e,t,i){super(r),this.name="SemanticParseError",this.language=e,this.input=t,this.diagnostics=i;}};function T(r,e,t){return {message:r,severity:e,source:"semantic-parser",...t&&{code:t}}}function ye(r,e){return e.length===0?r:{...r,diagnostics:e}}var X=class P{parse(e,t){let{modifiers:i,remainingInput:a}=this.extractStandaloneModifiers(e,t),u=a||e,n=[],o=ne(u,t),s=G(t);if(s.length===0)throw new Ge(`No patterns available for language: ${t}`,t,u,[T(`No patterns registered for language '${t}'`,"error","no-patterns")]);let l=[...s].sort((v,g)=>g.priority-v.priority),m=l.filter(v=>v.command==="on"),c=O.matchBest(o,m);if(c){n.push(T(`event pattern matched: ${c.pattern.id} (confidence: ${c.confidence.toFixed(2)})`,"info","pattern-match"));let v=this.buildEventHandler(c,o,t),g=i?this.applyModifiers(v,i):v;return ye(g,n)}n.push(T(`event patterns: ${m.length} tried, no match`,"info","stage-event"));let p=l.filter(v=>v.command!=="on"),d=O.matchBest(o,p);if(d)return n.push(T(`command pattern matched: ${d.pattern.id} (confidence: ${d.confidence.toFixed(2)})`,"info","pattern-match")),ye(this.buildCommand(d,t),n);n.push(T(`command patterns: ${p.length} tried, no match`,"info","stage-command"));let f=this.trySOVEventExtraction(u,t,l);if(f){n.push(T("SOV event extraction succeeded","info","stage-sov"));let v=i?this.applyModifiers(f,i):f;return ye(v,n)}n.push(T("SOV event extraction: no event keyword found","info","stage-sov"));let E=this.tryCompoundCommandParsing(o,p,t);if(E)return n.push(T("compound command parsing succeeded","info","stage-compound")),ye(E,n);throw n.push(T("compound parsing: no then-keywords or no command matches","info","stage-compound")),n.push(T(`all parse stages exhausted for "${u}"`,"error","parse-failed")),new Ge(`Could not parse input in ${t}: ${u}`,t,u,n)}canParse(e,t){try{return this.parse(e,t),!0}catch{return false}}supportedLanguages(){return nr()}buildCommand(e,t){if(!e)throw new Error("No match to build command from");let i={};for(let[a,u]of e.captured)i[a]=u;return de(e.pattern.command,i,{sourceLanguage:t,patternId:e.pattern.id,confidence:e.confidence})}buildEventHandler(e,t,i){if(!e)throw new Error("No match to build event handler from");let a=e.captured.get("event");if(!a)throw new Error("Event handler pattern matched but no event captured");let u=O.extractEventModifiers(t),n=this.extractOrConjunctionEvents(t,i),o=a;n.length>0&&a.type==="literal"&&(o={type:"literal",value:[String(a.value),...n.map(c=>String("value"in c?c.value:""))].join(" or ")});let s,l=e.captured.get("action");if(l&&l.type==="literal"){let m=l.value,c={};for(let[f,E]of e.captured)f!=="event"&&f!=="action"&&f!=="continues"&&(c[f]=E);let p=de(m,c,{sourceLanguage:i,patternId:e.pattern.id,confidence:e.confidence}),d=e.captured.get("continues");if(d&&d.type==="literal"&&d.value==="then"){let f=G(i).filter(g=>g.command!=="on").sort((g,k)=>k.priority-g.priority),E=G(i).filter(g=>g.id.startsWith("grammar-")&&g.id.includes("-continuation")).sort((g,k)=>k.priority-g.priority),v=this.parseBodyWithGrammarPatterns(t,f,E,i);v.length>0?s=[p,...v]:s=[p];}else s=[p];}else {let m=G(i).filter(c=>c.command!=="on").sort((c,p)=>p.priority-c.priority);s=this.parseBodyWithClauses(t,m,i);}return $e(o,s,u,{sourceLanguage:i,patternId:e.pattern.id,confidence:e.confidence})}parseBodyWithClauses(e,t,i){let a=[],u=[];for(;!e.isAtEnd();){let n=e.peek();if(!n)break;let o=n.kind==="conjunction"||n.kind==="keyword"&&this.isThenKeyword(n.value,i),s=n.kind==="keyword"&&this.isEndKeyword(n.value,i);if(o){if(u.length>0){let l=this.parseClause(u,t,i);a.push(...l),u.length=0;}e.advance();continue}if(s){if(u.length>0){let l=this.parseClause(u,t,i);a.push(...l);}e.advance();break}u.push(n),e.advance();}if(u.length>0){let n=this.parseClause(u,t,i);a.push(...n);}return a.length>1?[Ve(a,"then",{sourceLanguage:i})]:a}parseClause(e,t,i){if(e.length===0)return [];let a=new te(e,i),u=[];for(;!a.isAtEnd();){let n=O.matchBest(a,t);n?u.push(this.buildCommand(n,i)):a.advance();}if(u.length===0){let n=this.parseSOVClauseByVerbAnchoring(e,i);if(n.length>0)return n}return u}static buildVerbLookup(e){let t=new Map;for(let[i,a]of Object.entries(e.keywords))if(!["on","if","else","when","where","while","for","end","then","and"].includes(i)&&(t.set(a.primary.toLowerCase(),i),a.alternatives))for(let u of a.alternatives)t.set(u.toLowerCase(),i);return t}static buildMarkerToRoleLookup(e){let t=new Map;for(let[i,a]of Object.entries(e.roleMarkers))if(a&&(t.set(a.primary,i),a.alternatives))for(let u of a.alternatives)t.has(u)||t.set(u,i);return t}parseSOVClauseByVerbAnchoring(e,t){let i=L(t);if(!i||i.wordOrder!=="SOV")return [];let a=P.buildVerbLookup(i),u=P.buildMarkerToRoleLookup(i),n=[],o=0;for(;o<e.length;){let s=-1,l="";for(let f=o;f<e.length;f++){let E=e[f],v=a.get(E.value.toLowerCase()),g=E.normalized?a.get(E.normalized.toLowerCase()):void 0,k=v||g;if(k){s=f,l=k;break}}if(s===-1)break;let m=e.slice(o,s),c=e.length;for(let f=s+1;f<e.length;f++){let E=e[f];if(E.kind==="conjunction"||this.isThenKeyword(E.value,t)){c=f;break}if(f>s+1&&(a.get(E.value.toLowerCase())||(E.normalized?a.get(E.normalized.toLowerCase()):void 0))){c=f;break}}let p=e.slice(s+1,c),d=this.extractRolesFromMarkedTokens(m,p,u,l,t);if(n.push(de(l,d,{sourceLanguage:t,confidence:.7})),o=c,o<e.length){let f=e[o];(f.kind==="conjunction"||this.isThenKeyword(f.value,t))&&o++;}}return n}extractRolesFromMarkedTokens(e,t,i,a,u){let n={},o=s=>{let l=[];for(let m of s){let c=i.get(m.value);if(c&&m.kind==="particle"&&l.length>0){let p=this.tokensToSemanticValue(l);if(p){let d=this.mapRoleForCommand(c,a,n);d&&(n[d]=p);}l=[];}else l.push(m);}if(l.length>0){let m=this.tokensToSemanticValue(l);m&&(n.patient?n.destination||(n.destination=m):n.patient=m);}};return o(e),o(t),n}mapRoleForCommand(e,t,i){return i[e]?e==="patient"&&!i.destination?"destination":e==="destination"&&!i.patient?"patient":e==="source"&&!i.source?"source":null:e}tokensToSemanticValue(e){if(e.length===0)return null;let t=e.filter(u=>u.kind!=="whitespace");if(t.length===0)return null;if(t.length===1)return this.tokenToSemanticValue(t[0]);let i=t.map(u=>u.value).join(""),a=t[0];return a.kind==="selector"||a.value.startsWith("#")||a.value.startsWith(".")||a.value.startsWith("@")||a.value.startsWith("*")?ue(i):a.kind==="literal"||a.value.startsWith('"')||a.value.startsWith("'")?A(i):a.kind==="reference"?I(i):A(i)}tokenToSemanticValue(e){let t=e.value;if(e.kind==="selector"||t.startsWith("#")||t.startsWith(".")||t.startsWith("@")||t.startsWith("*"))return ue(t);if(t.startsWith('"')||t.startsWith("'"))return A(t);if(/^-?\d+(\.\d+)?$/.test(t))return A(parseFloat(t));if(t==="true"||t==="\u771F"||t==="\uCC38"||t==="do\u011Fru")return A(true);if(t==="false"||t==="\u507D"||t==="\uAC70\uC9D3"||t==="yanl\u0131\u015F")return A(false);let i=e.normalized?.toLowerCase();return i==="me"||i==="it"||i==="you"||i==="result"||i==="body"?I(i):e.kind==="reference"?I(e.normalized||"me"):A(t)}parseBodyWithGrammarPatterns(e,t,i,a){let u=[];for(;!e.isAtEnd();){let n=e.peek();if(n&&this.isThenKeyword(n.value,a)){e.advance();continue}if(n&&this.isEndKeyword(n.value,a)){e.advance();break}let o=false;if(i.length>0){let s=O.matchBest(e,i);if(s){let l=s.pattern.command,m={};for(let[d,f]of s.captured)d!=="event"&&d!=="action"&&d!=="continues"&&(m[d]=f);let c=de(l,m,{sourceLanguage:a,patternId:s.pattern.id});u.push(c),o=true;let p=s.captured.get("continues");if(p&&p.type==="literal"&&p.value==="then")continue}}if(!o){let s=O.matchBest(e,t);s&&(u.push(this.buildCommand(s,a)),o=true);}o||e.advance();}return u}tryCompoundCommandParsing(e,t,i){let a=e.tokens;if(!a.some(s=>s.kind==="conjunction"||s.kind==="keyword"&&this.isThenKeyword(s.value,i)))return null;let n=new te(a,i),o=this.parseBodyWithClauses(n,t,i);return o.length===0?null:o.length===1?o[0]:Ve(o,"then",{sourceLanguage:i,confidence:.65})}trySOVEventExtraction(e,t,i){let a=P.SOV_EVENT_MARKERS[t];if(!a)return null;let n=ne(e,t).tokens,o=Kt[t],s=new Set;if(o)for(let z of Object.keys(o))s.add(z.toLowerCase());let l=P.SOV_SOURCE_MARKERS[t],m=-1,c="",p="",d=1;for(let z=0;z<n.length;z++){let D=n[z],N=D.value.toLowerCase(),_=N,$="",Ee=N.indexOf("[");Ee>0&&(_=N.slice(0,Ee),$=D.value.slice(Ee));let ge=D.normalized?.toLowerCase(),Te=ge&&P.KNOWN_EVENTS.has(ge),Pe=s.has(N)||s.has(_),Fr=P.KNOWN_EVENTS.has(_);if(Te||Pe||Fr){let Z;if(Te?Z=ge:Pe?Z=o?.[N]??o?.[_]??_:Z=_,a.size>0){let le=1,ze=n[z+1];ze&&ze.kind==="selector"&&ze.value.startsWith("[")&&(le=2);let me=n[z+le];if(me&&(me.kind==="particle"||me.kind==="keyword")&&a.has(me.value)){m=z,c=Z,p=$||(le===2?n[z+1].value:""),d=le+1;break}}else {m=z,c=Z,p=$,d=1;break}}}if(m===-1)return null;let f=new Set;for(let z=m;z<m+d;z++)f.add(z);if(l){let z=m+d;if(z<n.length){let D=n[z];(D.kind==="particle"||D.kind==="keyword")&&l.markers.has(D.value)&&f.add(z);}for(let D=0;D<m;D++){let N=n[D],_=N.value.toLowerCase(),$=N.normalized?.toLowerCase();if(l.windowTokens.has(_)||$&&l.windowTokens.has($)){f.add(D);break}}}let E=n.filter((z,D)=>!f.has(D));if(E.length===0)return null;let v=i.filter(z=>z.command!=="on"),g=new te(E,t),k=this.parseBodyWithClauses(g,v,t);if(k.length===0)return null;let Se={sourceLanguage:t,confidence:.75};return p&&(Se.keyFilter=p),$e({type:"literal",value:c},k,void 0,Se)}isThenKeyword(e,t){let i={en:new Set(["then"]),ja:new Set(["\u305D\u308C\u304B\u3089","\u6B21\u306B","\u305D\u3057\u3066"]),ar:new Set(["\u062B\u0645","\u0628\u0639\u062F\u0647\u0627","\u062B\u0645\u0651"]),es:new Set(["entonces","luego","despu\xE9s"]),ko:new Set(["\uADF8\uB2E4\uC74C","\uADF8\uB9AC\uACE0","\uADF8\uB7F0\uD6C4","\uADF8\uB7EC\uBA74"]),zh:new Set(["\u7136\u540E","\u63A5\u7740","\u4E4B\u540E"]),tr:new Set(["sonra","ard\u0131ndan","daha sonra"]),pt:new Set(["ent\xE3o","depois","logo"]),fr:new Set(["puis","ensuite","alors"]),de:new Set(["dann","danach","anschlie\xDFend"]),id:new Set(["lalu","kemudian","setelah itu"]),tl:new Set(["pagkatapos","tapos"]),bn:new Set(["\u09A4\u09BE\u09B0\u09AA\u09B0","\u09AA\u09B0\u09C7"]),qu:new Set(["chaymantataq","hinaspa","chaymanta","chayqa"]),sw:new Set(["kisha","halafu","baadaye"])};return (i[t]||i.en).has(e.toLowerCase())}isEndKeyword(e,t){let i={en:new Set(["end"]),ja:new Set(["\u7D42\u308F\u308A","\u7D42\u4E86","\u304A\u308F\u308A"]),ar:new Set(["\u0646\u0647\u0627\u064A\u0629","\u0627\u0646\u062A\u0647\u0649","\u0622\u062E\u0631"]),es:new Set(["fin","final","terminar"]),ko:new Set(["\uB05D","\uC885\uB8CC","\uB9C8\uCE68"]),zh:new Set(["\u7ED3\u675F","\u7EC8\u6B62","\u5B8C"]),tr:new Set(["son","biti\u015F","bitti"]),pt:new Set(["fim","final","t\xE9rmino"]),fr:new Set(["fin","terminer","finir"]),de:new Set(["ende","beenden","fertig"]),id:new Set(["selesai","akhir","tamat"]),tl:new Set(["wakas","tapos"]),bn:new Set(["\u09B8\u09AE\u09BE\u09AA\u09CD\u09A4"]),qu:new Set(["tukukuy","tukuy","puchukay"]),sw:new Set(["mwisho","maliza","tamati"])};return (i[t]||i.en).has(e.toLowerCase())}extractStandaloneModifiers(e,t){let a=ne(e,t).tokens;if(a.length===0)return {modifiers:null,remainingInput:null};let n=a[0].value.toLowerCase(),o=P.STANDALONE_MODIFIERS[n];if(!o)return {modifiers:null,remainingInput:null};let s={},l=1;if(o==="once")s.once=true;else {let d=1;if(d<a.length){let f=a[d];(f.kind==="keyword"||f.kind==="particle")&&(d++,l++);}if(d<a.length){let f=a[d];if(f.kind==="literal"){let E=f.value.match(/^(\d+)(ms|s|m)?$/);if(E){let v=parseInt(E[1],10),g=E[2]||"ms";g==="s"?v*=1e3:g==="m"&&(v*=6e4),s[o]=v,l=d+1;}}}s[o]||(s[o]=o==="debounce"?300:100);}let m=a.slice(l);if(m.length===0)return {modifiers:null,remainingInput:null};let c=m[0].position.start,p=e.slice(c);return {modifiers:s,remainingInput:p}}applyModifiers(e,t){return {...e,eventModifiers:{...e.eventModifiers,...t}}}extractOrConjunctionEvents(e,t){let i=[];for(;;){let a=e.mark(),u=e.peek();if(!u)break;let n=(u.normalized||u.value).toLowerCase();if(!P.OR_KEYWORDS.has(n)){e.reset(a);break}e.advance();let o=e.peek();if(!o){e.reset(a);break}let s=(o.normalized||o.value).toLowerCase();e.advance(),i.push({type:"literal",value:s});}return i}};X.KNOWN_EVENTS=new Set(["click","dblclick","input","change","submit","keydown","keyup","keypress","mouseover","mouseout","mousedown","mouseup","focus","blur","load","scroll","resize","contextmenu"]);X.SOV_EVENT_MARKERS={ja:new Set(["\u3067"]),ko:new Set,tr:new Set(["de","da","te","ta"]),bn:new Set(["\u098F"]),qu:new Set(["pi"])};X.SOV_SOURCE_MARKERS={ja:{markers:new Set(["\u304B\u3089"]),windowTokens:new Set(["\u30A6\u30A3\u30F3\u30C9\u30A6","\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8","window","document"])},ko:{markers:new Set(["\uC5D0\uC11C"]),windowTokens:new Set(["\uCC3D","\uC708\uB3C4\uC6B0","\uBB38\uC11C","window","document"])},tr:{markers:new Set(["den","dan","ten","tan"]),windowTokens:new Set(["pencere","belge","window","document"])},bn:{markers:new Set(["\u09A5\u09C7\u0995\u09C7","\u09AE\u09A7\u09CD\u09AF\u09C7"]),windowTokens:new Set(["\u0989\u0987\u09A8\u09CD\u09A1\u09CB","\u09A1\u0995\u09C1\u09AE\u09C7\u09A8\u09CD\u099F","window","document"])},qu:{markers:new Set(["manta"]),windowTokens:new Set(["k_iri","ventana","window","document"])}};X.STANDALONE_MODIFIERS={once:"once",debounced:"debounce",debounce:"debounce",throttled:"throttle",throttle:"throttle"};X.OR_KEYWORDS=new Set(["or","\u0623\u0648","o","ou","oder","atau","atau","\u6216","\u307E\u305F\u306F","\uB610\uB294","veya","\u0985\u09A5\u09AC\u09BE","utaq","au","\u0430\u0431\u043E","\u0438\u043B\u0438","ho\u1EB7c","lub","\u05D0\u05D5","\u0E2B\u0E23\u0E37\u0E2D","o"]);var na=X,oa=new na;function sa(r,e){return oa.parse(r,e)}function la(r,e){try{let t=ne(r,e),i=G(e);if(i.length===0)return {confidence:0,parseSuccess:!1,error:`No patterns available for language: ${e}`};let a=[...i].sort((l,m)=>m.priority-l.priority),u=a.filter(l=>l.command==="on"),n=O.matchBest(t,u);if(n)return {confidence:n.confidence,parseSuccess:!0,patternId:n.pattern.id,action:n.pattern.command,tokensConsumed:n.consumedTokens};t.reset(t.mark());let o=a.filter(l=>l.command!=="on"),s=O.matchBest(t,o);return s?{confidence:s.confidence,parseSuccess:!0,patternId:s.pattern.id,action:s.pattern.command,tokensConsumed:s.consumedTokens}:{confidence:0,parseSuccess:!1,error:`Could not match any patterns for: ${r}`}}catch(t){return {confidence:0,parseSuccess:false,error:t instanceof Error?t.message:String(t)}}}function lr(r,e){try{let i=sa(r,e);if(i)return {node:i,confidence:i.metadata?.confidence??.8,error:void 0,tokensConsumed:ne(r,e).tokens.length}}catch{}let t=la(r,e);return t.parseSuccess?{node:null,confidence:t.confidence,error:void 0,tokensConsumed:t.tokensConsumed}:{node:null,confidence:0,error:t.error}}function mr(r,e){let t=e==="SOV"?"sovPosition":"svoPosition";return [...r].sort((i,a)=>{let u=i[t]??99,n=a[t]??99;return u-n})}function ma(r,e){let t=r.markerOverride?.[e.code],i=e.roleMarkers[r.role];if(t!==void 0)return {primary:t,position:i?.position??"before",isOverride:true};if(i&&i.primary){let a={primary:i.primary,position:i.position,isOverride:false};return i.alternatives&&(a.alternatives=i.alternatives),a}return null}function ca(r,e,t,i,a){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let l=i.primary.split(/\s+/);if(l.length>1)for(let m of l)u.push({type:"literal",value:m});else {let m=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(m);}}let n=e.roleMarkers.destination;n&&u.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary}]}),u.push({type:"role",role:"patient",optional:false});let o=e.roleMarkers.patient;if(o){let l=o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary};u.push(l);}let s=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(s),{id:`${r.action}-event-${e.code}-sov`,language:e.code,command:"on",priority:(a.basePriority??100)+50,template:{format:`{event} ${i.primary} {destination?} {patient} ${o?.primary||""} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function pa(r,e,t,i,a){let u=[];u.push({type:"role",role:"patient",optional:false});let n=e.roleMarkers.patient;if(n){let s=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};u.push(s);}if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let s=i.primary.split(/\s+/);if(s.length>1)for(let l of s)u.push({type:"literal",value:l});else {let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}}let o=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(o),{id:`${r.action}-event-${e.code}-sov-patient-first`,language:e.code,command:"on",priority:(a.basePriority??100)+45,template:{format:`{patient} ${n?.primary||""} {event} ${i.primary} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function da(r,e,t,i,a){let u=[];u.push({type:"role",role:"patient",optional:false});let n=e.roleMarkers.patient;if(n){let l=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};u.push(l);}let o=e.roleMarkers.destination;if(o&&(u.push({type:"role",role:"destination",optional:false}),u.push(o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary})),u.push({type:"role",role:"event",optional:false}),i.position==="after"){let l=i.primary.split(/\s+/);if(l.length>1)for(let m of l)u.push({type:"literal",value:m});else {let m=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(m);}}let s=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(s),{id:`${r.action}-event-${e.code}-sov-patient-first-dest`,language:e.code,command:"on",priority:(a.basePriority??100)+40,template:{format:`{patient} ${n?.primary||""} {destination} ${o?.primary||""} {event} ${i.primary} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination"}}}}function ya(r,e,t,i,a){let u=[];u.push({type:"role",role:"event",optional:false});let n=i.alternatives?.filter(m=>!m.includes(" ")&&m.length>1)||[];n.length>0&&u.push({type:"literal",value:n[0],alternatives:n.slice(1)});let o=e.roleMarkers.destination;o&&u.push({type:"group",optional:true,tokens:[{type:"role",role:"destination",optional:true},o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary}]}),u.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.patient;if(s){let m=s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary};u.push(m);}let l=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(l),{id:`${r.action}-event-${e.code}-sov-compact`,language:e.code,command:"on",priority:(a.basePriority??100)+52,template:{format:`{event}${n[0]||""} {patient} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function fa(r,e,t,i,a){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let o=i.primary.split(/\s+/);if(o.length>1)for(let s of o)u.push({type:"literal",value:s});else {let s=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(s);}}let n=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(n),{id:`${r.action}-event-${e.code}-sov-simple`,language:e.code,command:"on",priority:(a.basePriority??100)+48,template:{format:`{event} ${i.primary} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{default:{type:"reference",value:"me"}}}}}function ha(r,e,t,i){let a=e.eventHandler?.temporalMarkers;if(!a||a.length===0)return null;let u=[];u.push({type:"role",role:"event",optional:false}),e.possessive?.marker&&u.push({type:"group",optional:true,tokens:[{type:"literal",value:e.possessive.marker}]}),u.push({type:"literal",value:a[0],alternatives:a.slice(1)}),u.push({type:"role",role:"patient",optional:false});let n=e.roleMarkers.patient;if(n?.primary){let s=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};u.push(s);}let o=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};return u.push(o),{id:`${r.action}-event-${e.code}-sov-temporal`,language:e.code,command:"on",priority:(i.basePriority??100)+49,template:{format:`{event} ${a[0]} {patient} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"}}}}function va(r,e,t,i,a){let u=[];if(u.push({type:"role",role:"event",optional:false}),i.position==="after"){let m=i.primary.split(/\s+/);if(m.length>1)for(let c of m)u.push({type:"literal",value:c});else {let c=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(c);}}let o=[...r.roles.filter(m=>m.required)].sort((m,c)=>{let p=m.sovPosition??999,d=c.sovPosition??999;return p-d});for(let m of o){u.push({type:"role",role:m.role,optional:false});let c,p;if(m.markerOverride&&m.markerOverride[e.code]!==void 0)c=m.markerOverride[e.code];else {let d=e.roleMarkers[m.role];d&&(c=d.primary,p=d.alternatives);}if(c){let d=p?{type:"literal",value:c,alternatives:p}:{type:"literal",value:c};u.push(d);}}let s=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(s);let l=o.map(m=>`{${m.role}}`).join(" ");return {id:`${r.action}-event-${e.code}-sov-2role`,language:e.code,command:"on",priority:(a.basePriority??100)+55,template:{format:`{event} ${i.primary} ${l} ${t.primary}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},...Object.fromEntries(o.map(m=>[m.role,{fromRole:m.role}]))}}}function Ea(r,e,t,i,a){let u=[],o=[...r.roles.filter(f=>f.required)].sort((f,E)=>{let v=f.sovPosition??999,g=E.sovPosition??999;return v-g}),s=o[0];u.push({type:"role",role:s.role,optional:false});let l;if(s.markerOverride&&s.markerOverride[e.code]!==void 0)l=s.markerOverride[e.code];else {let f=e.roleMarkers[s.role];f&&(l=f.primary);}if(l&&u.push({type:"literal",value:l}),u.push({type:"role",role:"event",optional:false}),i.position==="after"){let f=i.primary.split(/\s+/);if(f.length>1)for(let E of f)u.push({type:"literal",value:E});else {let E=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(E);}}let m=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(m);let c=o[1];u.push({type:"role",role:c.role,optional:false});let p,d;if(c.markerOverride&&c.markerOverride[e.code]!==void 0)p=c.markerOverride[e.code];else {let f=e.roleMarkers[c.role];f&&(p=f.primary,d=f.alternatives);}if(p){let f=d?{type:"literal",value:p,alternatives:d}:{type:"literal",value:p};u.push(f);}return {id:`${r.action}-event-${e.code}-sov-2role-dest-first`,language:e.code,command:"on",priority:(a.basePriority??100)+48,template:{format:`{${s.role}} {event} ${i.primary} ${t.primary} {${c.role}}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},[s.role]:{fromRole:s.role},[c.role]:{fromRole:c.role}}}}function He(r,e,t,i,a){let u=[];if(i.position==="before"){let s=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(s);}u.push({type:"role",role:"event",optional:false});let n=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(n),u.push({type:"role",role:"patient",optional:false});let o=e.roleMarkers.destination;return o&&u.push({type:"group",optional:true,tokens:[o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary},{type:"role",role:"destination",optional:true}]}),{id:`${r.action}-event-${e.code}-vso`,language:e.code,command:"on",priority:(a.basePriority??100)+50,template:{format:`${i.primary} {event} ${t.primary} {patient} ${o?.primary||""} {destination?}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function ga(r,e,t,i,a){let u=[],n=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(n),u.push({type:"role",role:"patient",optional:false});let o=e.roleMarkers.destination;if(o&&u.push({type:"group",optional:true,tokens:[o.alternatives?{type:"literal",value:o.primary,alternatives:o.alternatives}:{type:"literal",value:o.primary},{type:"role",role:"destination",optional:true}]}),i.position==="before"){let s=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(s);}return u.push({type:"role",role:"event",optional:false}),{id:`${r.action}-event-${e.code}-vso-verb-first`,language:e.code,command:"on",priority:(a.basePriority??100)+45,template:{format:`${t.primary} {patient} ${o?.primary||""} {destination?} ${i.primary} {event}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function za(r,e,t,i,a){let u=[],n=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(n);let s=[...r.roles.filter(m=>m.required)].sort((m,c)=>{let p=m.svoPosition??999,d=c.svoPosition??999;return p-d});for(let m of s){let c,p;if(m.markerOverride&&m.markerOverride[e.code]!==void 0)c=m.markerOverride[e.code];else {let d=e.roleMarkers[m.role];d&&(c=d.primary,p=d.alternatives);}if(c){let d=p?{type:"literal",value:c,alternatives:p}:{type:"literal",value:c};u.push(d);}u.push({type:"role",role:m.role,optional:false});}if(i.position==="before"){let m=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(m);}u.push({type:"role",role:"event",optional:false});let l=s.map(m=>`{${m.role}}`).join(" ");return {id:`${r.action}-event-${e.code}-vso-verb-first-2role`,language:e.code,command:"on",priority:(a.basePriority??100)+48,template:{format:`${t.primary} ${l} ${i.primary} {event}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},...Object.fromEntries(s.map(m=>[m.role,{fromRole:m.role}]))}}}function Ye(r,e,t,i,a){let u=[];if(i.position==="before"){let m=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(m);}u.push({type:"role",role:"event",optional:false});let n=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(n);let s=[...r.roles.filter(m=>m.required)].sort((m,c)=>{let p=m.svoPosition??999,d=c.svoPosition??999;return p-d});for(let m of s){let c,p;if(m.markerOverride&&m.markerOverride[e.code]!==void 0)c=m.markerOverride[e.code];else {let d=e.roleMarkers[m.role];d&&(c=d.primary,p=d.alternatives);}if(c){let d=p?{type:"literal",value:c,alternatives:p}:{type:"literal",value:c};u.push(d);}u.push({type:"role",role:m.role,optional:false});}let l=s.map(m=>`{${m.role}}`).join(" ");return {id:`${r.action}-event-${e.code}-vso-2role`,language:e.code,command:"on",priority:(a.basePriority??100)+55,template:{format:`${i.primary} {event} ${t.primary} ${l}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},...Object.fromEntries(s.map(m=>[m.role,{fromRole:m.role}]))}}}function ka(r,e,t,i,a){let u=[],n=e.eventHandler?.negationMarker;if(i.position==="before"){let l=i.alternatives?{type:"literal",value:i.primary,alternatives:i.alternatives}:{type:"literal",value:i.primary};u.push(l);}if(n){let l=n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary};u.push(l);}u.push({type:"role",role:"event",optional:false});let o=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};u.push(o),u.push({type:"role",role:"patient",optional:false});let s=e.roleMarkers.destination;return s&&u.push({type:"group",optional:true,tokens:[s.alternatives?{type:"literal",value:s.primary,alternatives:s.alternatives}:{type:"literal",value:s.primary},{type:"role",role:"destination",optional:true}]}),{id:`${r.action}-event-${e.code}-vso-negated`,language:e.code,command:"on",priority:(a.basePriority??100)+48,template:{format:`${i.primary} ${n?.primary||""} {event} ${t.primary} {patient} ${s?.primary||""} {destination?}`,tokens:u},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}function Ca(r,e,t,i){let a=[];a.push({type:"literal",value:"and",alternatives:["then"]}),a.push({type:"role",role:"event",optional:false});let u=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary};a.push(u),a.push({type:"role",role:"patient",optional:false});let n=e.roleMarkers.destination;return n&&a.push({type:"group",optional:true,tokens:[n.alternatives?{type:"literal",value:n.primary,alternatives:n.alternatives}:{type:"literal",value:n.primary},{type:"role",role:"destination",optional:true}]}),{id:`${r.action}-event-${e.code}-vso-proclitic`,language:e.code,command:"on",priority:(i.basePriority??100)+45,template:{format:`[proclitic?] {event} ${t.primary} {patient} ${n?.primary||""} {destination?}`,tokens:a},extraction:{action:{value:r.action},event:{fromRole:"event"},patient:{fromRole:"patient"},destination:{fromRole:"destination",default:{type:"reference",value:"me"}}}}}var oe={basePriority:100,generateSimpleVariants:true,generateAlternatives:true};function cr(r,e,t=oe){let i=`${r.action}-${e.code}-generated`,a=t.basePriority??100,u=e.keywords[r.action];if(!u)throw new Error(`No keyword translation for '${r.action}' in ${e.code}`);let n=Da(r,e,u),o=dr(r,e),s=Sa(r,e,u);return {id:i,language:e.code,command:r.action,priority:a,template:{format:s,tokens:n},extraction:o}}function ba(r,e,t=oe){if(r.roles.filter(o=>!o.required).length===0)return null;let a=r.roles.filter(o=>o.required),u={...r,roles:a};return {...cr(u,e,t),id:`${r.action}-${e.code}-generated-simple`,priority:(t.basePriority??100)-5,extraction:dr(r,e)}}function Aa(r,e,t=oe){let i=[];if(i.push(cr(r,e,t)),t.generateSimpleVariants){let a=ba(r,e,t);a&&i.push(a);}return i}function pr(r,e=oe){let t=[],i=ua();for(let a of i){if(!r.keywords[a.action])continue;let u=Aa(a,r,e);if(t.push(...u),r.eventHandler?.eventMarker){let n=wa(a,r,e);t.push(...n);}}return t}function wa(r,e,t=oe){if(!e.eventHandler||!e.eventHandler.eventMarker)return [];let i=[],a=e.eventHandler.eventMarker,u=e.keywords[r.action];if(!u)return [];let o=r.roles.filter(s=>s.required).length===2;if(e.wordOrder==="SOV")if(o)i.push(va(r,e,u,a,t)),i.push(Ea(r,e,u,a,t));else {i.push(ca(r,e,u,a,t)),i.push(pa(r,e,u,a,t));let s=e.roleMarkers.destination;s&&s.primary!==a.primary&&i.push(da(r,e,u,a,t));let l=a.primary.split(/\s+/),m=a.alternatives?.some(p=>!p.includes(" ")&&p.length>1);l.length>1&&m&&i.push(ya(r,e,u,a,t)),i.push(fa(r,e,u,a,t));let c=ha(r,e,u,t);c&&i.push(c);}else e.wordOrder==="VSO"?o?(i.push(Ye(r,e,u,a,t)),i.push(za(r,e,u,a,t))):(i.push(He(r,e,u,a,t)),i.push(ga(r,e,u,a,t)),e.eventHandler?.negationMarker&&i.push(ka(r,e,u,a,t)),e.tokenization?.prefixes&&i.push(Ca(r,e,u,t))):o?i.push(Ye(r,e,u,a,t)):i.push(He(r,e,u,a,t));return i}function Da(r,e,t){let i=[],a=t.alternatives?{type:"literal",value:t.primary,alternatives:t.alternatives}:{type:"literal",value:t.primary},u=xa(r,e);switch(e.wordOrder){case "SVO":i.push(a),i.push(...u);break;case "SOV":i.push(...u),i.push(a);break;case "VSO":i.push(a),i.push(...u);break;default:i.push(a),i.push(...u);}return i}function xa(r,e){let t=[],i=mr(r.roles,e.wordOrder);for(let a of i){let u=Ba(a,e);a.required?t.push(...u):t.push({type:"group",optional:true,tokens:u});}return t}function Ba(r,e){let t=[],i=r.markerOverride?.[e.code],a=e.roleMarkers[r.role],u={type:"role",role:r.role,optional:!r.required,expectedTypes:r.expectedTypes};if(i!==void 0){let n=i?i.split(/\s+/).filter(Boolean):[];if((a?.position??"before")==="before"){for(let s of n)t.push({type:"literal",value:s});t.push(u);}else {t.push(u);for(let s of n)t.push({type:"literal",value:s});}}else if(a)if(a.position==="before"){if(a.primary){let n=a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary};t.push(n);}t.push(u);}else {t.push(u);let n=a.alternatives?{type:"literal",value:a.primary,alternatives:a.alternatives}:{type:"literal",value:a.primary};t.push(n);}else t.push(u);return t}function Fa(r,e){let t={};for(let i of r.roles){let a=i.markerOverride?.[e.code],u=e.roleMarkers[i.role];a!==void 0?t[i.role]=a?{marker:a}:{}:u&&u.primary?t[i.role]=u.alternatives?{marker:u.primary,markerAlternatives:u.alternatives}:{marker:u.primary}:t[i.role]={};}return t}function dr(r,e){let t=Fa(r,e),i={};for(let a of r.roles){let u=t[a.role]||{};!a.required&&a.default?i[a.role]={...u,default:a.default}:i[a.role]=u;}return i}function Sa(r,e,t){let i=[],u=mr(r.roles,e.wordOrder).map(n=>{let o=ma(n,e),s="";return o&&o.primary?o.position==="before"?s=`${o.primary} {${n.role}}`:s=`{${n.role}} ${o.primary}`:s=`{${n.role}}`,n.required?s:`[${s}]`});switch(e.wordOrder){case "SVO":case "VSO":i.push(t.primary,...u);break;case "SOV":i.push(...u,t.primary);break;default:i.push(t.primary,...u);}return i.join(" ")}var Ta=class{constructor(r={}){this.cache=new Map,this.config={maxSize:r.maxSize??1e3,ttlMs:r.ttlMs??0,enabled:r.enabled??true},this.stats={hits:0,misses:0,evictions:0,expirations:0};}makeKey(r,e){return `${e}:${r}`}isExpired(r){return this.config.ttlMs===0?false:Date.now()-r.createdAt>this.config.ttlMs}evictLRU(){let r=this.cache.keys().next().value;r!==void 0&&(this.cache.delete(r),this.stats.evictions++);}get(r,e){if(!this.config.enabled){this.stats.misses++;return}let t=this.makeKey(r,e),i=this.cache.get(t);if(!i){this.stats.misses++;return}if(this.isExpired(i)){this.cache.delete(t),this.stats.expirations++,this.stats.misses++;return}return this.cache.delete(t),i.lastAccessed=Date.now(),this.cache.set(t,i),this.stats.hits++,i.result}set(r,e,t){if(!this.config.enabled||t!==null&&typeof t=="object"&&"confidence"in t&&t.confidence===0)return;let i=this.makeKey(r,e),a=Date.now();for(;this.cache.size>=this.config.maxSize;)this.evictLRU();this.cache.set(i,{result:t,createdAt:a,lastAccessed:a});}has(r,e){if(!this.config.enabled)return false;let t=this.makeKey(r,e),i=this.cache.get(t);return i?this.isExpired(i)?(this.cache.delete(t),this.stats.expirations++,false):true:false}delete(r,e){let t=this.makeKey(r,e);return this.cache.delete(t)}clear(){this.cache.clear();}resetStats(){this.stats={hits:0,misses:0,evictions:0,expirations:0};}getStats(){let r=this.stats.hits+this.stats.misses;return {hits:this.stats.hits,misses:this.stats.misses,size:this.cache.size,maxSize:this.config.maxSize,hitRate:r>0?this.stats.hits/r:0,evictions:this.stats.evictions,expirations:this.stats.expirations,enabled:this.config.enabled}}configure(r){if(r.maxSize!==void 0)for(this.config.maxSize=r.maxSize;this.cache.size>this.config.maxSize;)this.evictLRU();r.ttlMs!==void 0&&(this.config.ttlMs=r.ttlMs),r.enabled!==void 0&&(this.config.enabled=r.enabled);}enable(){this.config.enabled=true;}disable(){this.config.enabled=false;}getConfig(){return {...this.config}}};new Ta;function Pa(r){return /[а-яА-ЯёЁ]/.test(r)}function Ra(r){for(let e of r)if(Pa(e))return true;return false}var yr=new Map([["\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438","\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C"],["\u0434\u043E\u0431\u0430\u0432\u044C","\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C"],["\u0443\u0434\u0430\u043B\u0438","\u0443\u0434\u0430\u043B\u0438\u0442\u044C"],["\u0443\u0431\u0435\u0440\u0438","\u0443\u0431\u0440\u0430\u0442\u044C"],["\u043F\u043E\u043B\u043E\u0436\u0438","\u043F\u043E\u043B\u043E\u0436\u0438\u0442\u044C"],["\u043F\u043E\u043C\u0435\u0441\u0442\u0438","\u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C"],["\u0432\u0441\u0442\u0430\u0432\u044C","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C"],["\u0432\u043E\u0437\u044C\u043C\u0438","\u0432\u0437\u044F\u0442\u044C"],["\u0441\u043E\u0437\u0434\u0430\u0439","\u0441\u043E\u0437\u0434\u0430\u0442\u044C"],["\u043A\u043B\u043E\u043D\u0438\u0440\u0443\u0439","\u043A\u043B\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u0442\u044C"],["\u043F\u043E\u043C\u0435\u043D\u044F\u0439","\u043F\u043E\u043C\u0435\u043D\u044F\u0442\u044C"],["\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0438\u0440\u0443\u0439","\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C"],["\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438","\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C"],["\u0437\u0430\u0434\u0430\u0439","\u0437\u0430\u0434\u0430\u0442\u044C"],["\u043F\u043E\u043B\u0443\u0447\u0438","\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C"],["\u0443\u0432\u0435\u043B\u0438\u0447\u044C","\u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C"],["\u0443\u043C\u0435\u043D\u044C\u0448\u0438","\u0443\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C"],["\u0437\u0430\u043F\u0438\u0448\u0438","\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C"],["\u043F\u043E\u043A\u0430\u0436\u0438","\u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C"],["\u0441\u043A\u0440\u043E\u0439","\u0441\u043A\u0440\u044B\u0442\u044C"],["\u0441\u043F\u0440\u044F\u0447\u044C","\u0441\u043F\u0440\u044F\u0442\u0430\u0442\u044C"],["\u0430\u043D\u0438\u043C\u0438\u0440\u0443\u0439","\u0430\u043D\u0438\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C"],["\u0432\u044B\u0437\u043E\u0432\u0438","\u0432\u044B\u0437\u0432\u0430\u0442\u044C"],["\u043E\u0442\u043F\u0440\u0430\u0432\u044C","\u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C"],["\u0441\u0444\u043E\u043A\u0443\u0441\u0438\u0440\u0443\u0439","\u0441\u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C"],["\u0440\u0430\u0437\u043C\u043E\u0439","\u0440\u0430\u0437\u043C\u044B\u0442\u044C"],["\u043F\u0435\u0440\u0435\u0439\u0434\u0438","\u043F\u0435\u0440\u0435\u0439\u0442\u0438"],["\u0438\u0434\u0438","\u0438\u0434\u0442\u0438"],["\u0436\u0434\u0438","\u0436\u0434\u0430\u0442\u044C"],["\u043F\u043E\u0434\u043E\u0436\u0434\u0438","\u043F\u043E\u0434\u043E\u0436\u0434\u0430\u0442\u044C"],["\u0437\u0430\u0433\u0440\u0443\u0437\u0438","\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C"],["\u043F\u043E\u0432\u0442\u043E\u0440\u0438","\u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C"],["\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438","\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C"],["\u0431\u0440\u043E\u0441\u044C","\u0431\u0440\u043E\u0441\u0438\u0442\u044C"],["\u0432\u0435\u0440\u043D\u0438","\u0432\u0435\u0440\u043D\u0443\u0442\u044C"],["\u0441\u043A\u0430\u0436\u0438","\u0441\u043A\u0430\u0437\u0430\u0442\u044C"],["\u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u0443\u0439","\u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C"],["\u0438\u0437\u043C\u0435\u0440\u044C","\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u044C"]]),fr=class{constructor(){this.language="ru";}isNormalizable(r){return r.length<3?false:Ra(r)}normalize(r){let e=r.toLowerCase();if(e.endsWith("\u0441\u044F")||e.endsWith("\u0441\u044C")){let n=this.tryReflexiveNormalization(e);if(n)return n}if(e.endsWith("\u0442\u044C")||e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u044C"))return w(r);let t=this.tryImperativeLookup(e);if(t)return t;let i=this.tryPastTenseNormalization(e);if(i)return i;let a=this.tryPresentTenseNormalization(e);if(a)return a;let u=this.tryGenericImperativeNormalization(e);return u||w(r)}tryReflexiveNormalization(r){(r.endsWith("\u0441\u044F"),2);let t=r.slice(0,-2);if(r.endsWith("\u0442\u044C\u0441\u044F")||r.endsWith("\u0442\u0438\u0441\u044C")||r.endsWith("\u0447\u044C\u0441\u044F"))return w(r);let i=this.normalizeNonReflexive(t);if(i.confidence<1){let a=i.stem.endsWith("\u0442\u044C")?i.stem.slice(0,-2)+"\u0442\u044C\u0441\u044F":i.stem+"\u0441\u044F";return y(a,i.confidence*.95,{removedSuffixes:["\u0441\u044F",...i.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(r){if(r.endsWith("\u0442\u044C")||r.endsWith("\u0442\u0438")||r.endsWith("\u0447\u044C"))return w(r);let e=this.tryImperativeLookup(r);if(e)return e;let t=this.tryPastTenseNormalization(r);if(t)return t;let i=this.tryPresentTenseNormalization(r);if(i)return i;let a=this.tryGenericImperativeNormalization(r);return a||w(r)}tryImperativeLookup(r){return yr.has(r)?y(yr.get(r),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(r){return r.endsWith("\u0439\u0442\u0435")&&r.length>5?y(r.slice(0,-3)+"\u0442\u044C",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):r.endsWith("\u0438\u0442\u0435")&&r.length>5?y(r.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0442\u0435"],conjugationType:"imperative"}):r.endsWith("\u0439")&&r.length>3?y(r.slice(0,-1)+"\u0442\u044C",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):r.endsWith("\u0438")&&r.length>3?y(r+"\u0442\u044C",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u044C"],conjugationType:"imperative"}):null}tryPastTenseNormalization(r){return r.endsWith("\u0430\u043B\u0430")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):r.endsWith("\u0438\u043B\u0430")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):r.endsWith("\u0435\u043B\u043E")&&r.length>4?y(r.slice(0,-3)+"\u0435\u0442\u044C",.82,{removedSuffixes:["\u0435\u043B\u043E"],conjugationType:"past"}):r.endsWith("\u0430\u0431\u043E")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u0431\u043E"],conjugationType:"past"}):r.endsWith("\u0430\u043B\u0438")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u044C",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):r.endsWith("\u0438\u043B\u0438")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u044C",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):r.endsWith("\u0430\u043B")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u044C",.82,{removedSuffixes:["\u0430\u043B"],conjugationType:"past"}):r.endsWith("\u0438\u043B")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u044C",.82,{removedSuffixes:["\u0438\u043B"],conjugationType:"past"}):null}tryPresentTenseNormalization(r){return r.endsWith("\u0438\u0448\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u044C",.8,{removedSuffixes:["\u0438\u0448\u044C"],conjugationType:"present"}):r.endsWith("\u0438\u0442")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u0442"],conjugationType:"present"}):r.endsWith("\u0438\u043C")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u0438\u043C"],conjugationType:"present"}):r.endsWith("\u044F\u0442")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u044C",.78,{removedSuffixes:["\u044F\u0442"],conjugationType:"present"}):r.endsWith("\u0435\u0448\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u0435\u0448\u044C"],conjugationType:"present"}):r.endsWith("\u0435\u0442")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u0442"],conjugationType:"present"}):r.endsWith("\u0435\u043C")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0435\u043C"],conjugationType:"present"}):r.endsWith("\u044E\u0442")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u044C",.75,{removedSuffixes:["\u044E\u0442"],conjugationType:"present"}):r.endsWith("\u0443\u0442")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u044C",.72,{removedSuffixes:["\u0443\u0442"],conjugationType:"present"}):null}},hr={code:"ru",name:"Russian",nativeName:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,suffixes:["\u0442\u044C","\u0442\u044C\u0441\u044F","\u0438\u0442\u044C","\u0438\u0442\u044C\u0441\u044F","\u0430\u0442\u044C","\u0430\u0442\u044C\u0441\u044F","\u0435\u0442\u044C","\u0435\u0442\u044C\u0441\u044F"]},references:{me:"\u044F",it:"\u044D\u0442\u043E",you:"\u0442\u044B",result:"\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442",event:"\u0441\u043E\u0431\u044B\u0442\u0438\u0435",target:"\u0446\u0435\u043B\u044C",body:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,specialForms:{me:"\u043C\u043E\u0439",it:"\u0435\u0433\u043E",you:"\u0442\u0432\u043E\u0439"},keywords:{\u043C\u043E\u0439:"me",\u043C\u043E\u044F:"me",\u043C\u043E\u0451:"me",\u043C\u043E\u0438:"me",\u0442\u0432\u043E\u0439:"you",\u0442\u0432\u043E\u044F:"you",\u0442\u0432\u043E\u0451:"you",\u0442\u0432\u043E\u0438:"you",\u0435\u0433\u043E:"it",\u0435\u0451:"it"}},roleMarkers:{destination:{primary:"\u0432",alternatives:["\u043D\u0430","\u043A"],position:"before"},source:{primary:"\u0438\u0437",alternatives:["\u043E\u0442","\u0441"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"\u0441",alternatives:["\u0441\u043E"],position:"before"}},keywords:{toggle:{primary:"\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C",alternatives:["\u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438"],normalized:"toggle",form:"infinitive"},add:{primary:"\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C",alternatives:["\u0434\u043E\u0431\u0430\u0432\u044C"],normalized:"add",form:"infinitive"},remove:{primary:"\u0443\u0434\u0430\u043B\u0438\u0442\u044C",alternatives:["\u0443\u0434\u0430\u043B\u0438","\u0443\u0431\u0440\u0430\u0442\u044C","\u0443\u0431\u0435\u0440\u0438"],normalized:"remove",form:"infinitive"},put:{primary:"\u043F\u043E\u043B\u043E\u0436\u0438\u0442\u044C",alternatives:["\u043F\u043E\u043B\u043E\u0436\u0438","\u043F\u043E\u043C\u0435\u0441\u0442\u0438\u0442\u044C","\u043F\u043E\u043C\u0435\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C","\u0432\u0441\u0442\u0430\u0432\u044C"],normalized:"put",form:"infinitive"},append:{primary:"\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C_\u0432_\u043A\u043E\u043D\u0435\u0446",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u044C"],normalized:"append",form:"infinitive"},prepend:{primary:"\u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C_\u0432_\u043D\u0430\u0447\u0430\u043B\u043E",normalized:"prepend",form:"infinitive"},take:{primary:"\u0432\u0437\u044F\u0442\u044C",alternatives:["\u0432\u043E\u0437\u044C\u043C\u0438"],normalized:"take",form:"infinitive"},make:{primary:"\u0441\u043E\u0437\u0434\u0430\u0442\u044C",alternatives:["\u0441\u043E\u0437\u0434\u0430\u0439"],normalized:"make",form:"infinitive"},clone:{primary:"\u043A\u043B\u043E\u043D\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u043A\u043B\u043E\u043D\u0438\u0440\u0443\u0439"],normalized:"clone",form:"infinitive"},swap:{primary:"\u043F\u043E\u043C\u0435\u043D\u044F\u0442\u044C",alternatives:["\u043F\u043E\u043C\u0435\u043D\u044F\u0439"],normalized:"swap",form:"infinitive"},morph:{primary:"\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0438\u0440\u0443\u0439"],normalized:"morph",form:"infinitive"},set:{primary:"\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C",alternatives:["\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u044C","\u0437\u0430\u0434\u0430\u0439"],normalized:"set",form:"infinitive"},get:{primary:"\u043F\u043E\u043B\u0443\u0447\u0438\u0442\u044C",alternatives:["\u043F\u043E\u043B\u0443\u0447\u0438"],normalized:"get",form:"infinitive"},increment:{primary:"\u0443\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C",alternatives:["\u0443\u0432\u0435\u043B\u0438\u0447\u044C"],normalized:"increment",form:"infinitive"},decrement:{primary:"\u0443\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C",alternatives:["\u0443\u043C\u0435\u043D\u044C\u0448\u0438"],normalized:"decrement",form:"infinitive"},log:{primary:"\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C",alternatives:["\u0437\u0430\u043F\u0438\u0448\u0438"],normalized:"log",form:"infinitive"},show:{primary:"\u043F\u043E\u043A\u0430\u0437\u0430\u0442\u044C",alternatives:["\u043F\u043E\u043A\u0430\u0436\u0438"],normalized:"show",form:"infinitive"},hide:{primary:"\u0441\u043A\u0440\u044B\u0442\u044C",alternatives:["\u0441\u043A\u0440\u043E\u0439","\u0441\u043F\u0440\u044F\u0442\u0430\u0442\u044C","\u0441\u043F\u0440\u044F\u0447\u044C"],normalized:"hide",form:"infinitive"},transition:{primary:"\u0430\u043D\u0438\u043C\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u0430\u043D\u0438\u043C\u0438\u0440\u0443\u0439"],normalized:"transition",form:"infinitive"},on:{primary:"\u043F\u0440\u0438",normalized:"on"},trigger:{primary:"\u0438\u043D\u0438\u0446\u0438\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u044C","\u0437\u0430\u043F\u0443\u0441\u0442\u0438"],normalized:"trigger",form:"infinitive"},send:{primary:"\u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",alternatives:["\u043E\u0442\u043F\u0440\u0430\u0432\u044C"],normalized:"send",form:"infinitive"},focus:{primary:"\u0441\u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u0441\u0444\u043E\u043A\u0443\u0441\u0438\u0440\u0443\u0439","\u0444\u043E\u043A\u0443\u0441"],normalized:"focus",form:"infinitive"},blur:{primary:"\u0440\u0430\u0437\u043C\u044B\u0442\u044C",alternatives:["\u0440\u0430\u0437\u043C\u043E\u0439"],normalized:"blur",form:"infinitive"},empty:{primary:"\u043E\u043F\u0443\u0441\u0442\u043E\u0448\u0438\u0442\u044C",normalized:"empty"},open:{primary:"\u043E\u0442\u043A\u0440\u044B\u0442\u044C",normalized:"open"},close:{primary:"\u0437\u0430\u043A\u0440\u044B\u0442\u044C",normalized:"close"},select:{primary:"\u0432\u044B\u0434\u0435\u043B\u0438\u0442\u044C",normalized:"select"},clear:{primary:"\u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",normalized:"clear"},reset:{primary:"\u0441\u0431\u0440\u043E\u0441\u0438\u0442\u044C",normalized:"reset"},breakpoint:{primary:"\u0442\u043E\u0447\u043A\u0430-\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0430",normalized:"breakpoint"},click:{primary:"\u043A\u043B\u0438\u043A",alternatives:["\u043A\u043B\u0438\u043A\u0435","\u043D\u0430\u0436\u0430\u0442\u0438\u0438"],normalized:"click"},hover:{primary:"\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0438",alternatives:["\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u0438\u0435"],normalized:"hover"},submit:{primary:"\u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0435",alternatives:["\u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0430"],normalized:"submit"},input:{primary:"\u0432\u0432\u043E\u0434\u0435",alternatives:["\u0432\u0432\u043E\u0434"],normalized:"input"},change:{primary:"\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0438",alternatives:["\u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u0435"],normalized:"change"},go:{primary:"\u043F\u0435\u0440\u0435\u0439\u0442\u0438",alternatives:["\u043F\u0435\u0440\u0435\u0439\u0434\u0438","\u0438\u0434\u0442\u0438","\u0438\u0434\u0438"],normalized:"go",form:"infinitive"},scroll:{primary:"\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u0438\u0442\u044C",alternatives:["\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u0438"],normalized:"scroll",form:"infinitive"},push:{primary:"\u0432\u0442\u043E\u043B\u043A\u043D\u0443\u0442\u044C",alternatives:["\u0442\u043E\u043B\u043A\u043D\u0443\u0442\u044C"],normalized:"push",form:"infinitive"},replace:{primary:"\u0437\u0430\u043C\u0435\u043D\u0438\u0442\u044C",alternatives:["\u0437\u0430\u043C\u0435\u043D\u0438"],normalized:"replace",form:"infinitive"},process:{primary:"\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u0442\u044C",alternatives:["\u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u0439"],normalized:"process",form:"infinitive"},wait:{primary:"\u0436\u0434\u0430\u0442\u044C",alternatives:["\u0436\u0434\u0438","\u043F\u043E\u0434\u043E\u0436\u0434\u0438"],normalized:"wait",form:"infinitive"},fetch:{primary:"\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C",alternatives:["\u0437\u0430\u0433\u0440\u0443\u0437\u0438"],normalized:"fetch",form:"infinitive"},settle:{primary:"\u0441\u0442\u0430\u0431\u0438\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C",normalized:"settle",form:"infinitive"},if:{primary:"\u0435\u0441\u043B\u0438",normalized:"if"},when:{primary:"\u043A\u043E\u0433\u0434\u0430",normalized:"when"},where:{primary:"\u0433\u0434\u0435",normalized:"where"},else:{primary:"\u0438\u043D\u0430\u0447\u0435",normalized:"else"},repeat:{primary:"\u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",alternatives:["\u043F\u043E\u0432\u0442\u043E\u0440\u0438"],normalized:"repeat",form:"infinitive"},for:{primary:"\u0434\u043B\u044F",alternatives:["\u043A\u0430\u0436\u0434\u044B\u0439"],normalized:"for"},while:{primary:"\u043F\u043E\u043A\u0430",normalized:"while"},continue:{primary:"\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C",alternatives:["\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438"],normalized:"continue",form:"infinitive"},halt:{primary:"\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C",alternatives:["\u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0441\u044C","\u0441\u0442\u043E\u043F"],normalized:"halt",form:"infinitive"},throw:{primary:"\u0431\u0440\u043E\u0441\u0438\u0442\u044C",alternatives:["\u0431\u0440\u043E\u0441\u044C"],normalized:"throw",form:"infinitive"},call:{primary:"\u0432\u044B\u0437\u0432\u0430\u0442\u044C",alternatives:["\u0432\u044B\u0437\u043E\u0432\u0438"],normalized:"call",form:"infinitive"},return:{primary:"\u0432\u0435\u0440\u043D\u0443\u0442\u044C",alternatives:["\u0432\u0435\u0440\u043D\u0438"],normalized:"return",form:"infinitive"},then:{primary:"\u0437\u0430\u0442\u0435\u043C",alternatives:["\u043F\u043E\u0442\u043E\u043C","\u0442\u043E\u0433\u0434\u0430"],normalized:"then"},and:{primary:"\u0438",normalized:"and"},end:{primary:"\u043A\u043E\u043D\u0435\u0446",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"\u0430\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u043E",alternatives:["async"],normalized:"async"},tell:{primary:"\u0441\u043A\u0430\u0437\u0430\u0442\u044C",alternatives:["\u0441\u043A\u0430\u0436\u0438"],normalized:"tell",form:"infinitive"},default:{primary:"\u043F\u043E_\u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",normalized:"default"},init:{primary:"\u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u0443\u0439"],normalized:"init",form:"infinitive"},behavior:{primary:"\u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435",normalized:"behavior"},install:{primary:"\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C_\u043F\u0430\u043A\u0435\u0442",normalized:"install",form:"infinitive"},measure:{primary:"\u0438\u0437\u043C\u0435\u0440\u0438\u0442\u044C",alternatives:["\u0438\u0437\u043C\u0435\u0440\u044C"],normalized:"measure",form:"infinitive"},beep:{primary:"\u0437\u0432\u0443\u043A",normalized:"beep"},break:{primary:"\u043F\u0440\u0435\u0440\u0432\u0430\u0442\u044C",normalized:"break"},copy:{primary:"\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",normalized:"copy"},exit:{primary:"\u0432\u044B\u0439\u0442\u0438",normalized:"exit"},pick:{primary:"\u0432\u044B\u0431\u0440\u0430\u0442\u044C",normalized:"pick"},render:{primary:"\u043E\u0442\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u044C",normalized:"render"},into:{primary:"\u0432",alternatives:["\u0432\u043E"],normalized:"into"},before:{primary:"\u0434\u043E",alternatives:["\u043F\u0435\u0440\u0435\u0434"],normalized:"before"},after:{primary:"\u043F\u043E\u0441\u043B\u0435",normalized:"after"},until:{primary:"\u043F\u043E\u043A\u0430_\u043D\u0435",normalized:"until"},event:{primary:"\u0441\u043E\u0431\u044B\u0442\u0438\u0435",normalized:"event"},from:{primary:"\u0438\u0437",alternatives:["\u043E\u0442","\u0441"],normalized:"from"},connect:{primary:"\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C",alternatives:["\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u044C","\u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u044C\u0441\u044F"],normalized:"connect"},stream:{primary:"\u0442\u0440\u0430\u043D\u0441\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C",alternatives:["\u043F\u043E\u0442\u043E\u043A","\u0441\u0442\u0440\u0438\u043C"],normalized:"stream"},live:{primary:"\u0432-\u043F\u0440\u044F\u043C\u043E\u043C-\u044D\u0444\u0438\u0440\u0435",alternatives:["\u043F\u0440\u044F\u043C\u043E\u0439-\u044D\u0444\u0438\u0440","\u0432\u0436\u0438\u0432\u0443\u044E"],normalized:"live"},socket:{primary:"\u0441\u043E\u043A\u0435\u0442",alternatives:["\u0433\u043D\u0435\u0437\u0434\u043E","websocket"],normalized:"socket"}},eventHandler:{keyword:{primary:"\u043F\u0440\u0438",normalized:"on"},sourceMarker:{primary:"\u043D\u0430",alternatives:["\u0432","\u043F\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043F\u0440\u0438",position:"before"},temporalMarkers:["\u043A\u043E\u0433\u0434\u0430","\u0435\u0441\u043B\u0438"]}},Na=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],_a=class{constructor(r=Na){this.name="operator",this.operators=[...r].sort((e,t)=>t.length-e.length);}canExtract(r,e){return this.operators.some(t=>r.startsWith(t,e))}extract(r,e){for(let t of this.operators)if(r.startsWith(t,e))return {value:t,length:t.length};return null}},Oa="()[]{},:;",Ma=class{constructor(r=Oa){this.punctuation=r,this.name="punctuation";}canExtract(r,e){return this.punctuation.includes(r[e])}extract(r,e){let t=r[e];return this.punctuation.includes(t)?{value:t,length:1}:null}};function Ia(r,e){let t=r[e];if(t==="#"){let i=r.slice(e).match(/^#[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="."){let i=r.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="["){let i=0,a=e;for(;a<r.length;){if(r[a]==="["&&i++,r[a]==="]"&&(i--,i===0))return r.slice(e,a+1);a++;}return null}if(t==="<"){let i=r.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return i?i[0]:null}return null}var ja=class{constructor(){this.name="css-selector";}canExtract(r,e){let t=r[e];return t==="#"||t==="."||t==="["||t==="<"}extract(r,e){let t=Ia(r,e);return t?{value:t,length:t.length,metadata:{type:"css-selector"}}:null}},La=class{constructor(){this.name="event-modifier";}canExtract(r,e){if(r[e]!==".")return false;let t=r.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(t)}extract(r,e){let t=r.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!t)return null;let i=t[0],a=i.slice(1).split("(")[0],u=t[1];return {value:i,length:i.length,metadata:{modifierName:a,value:u?a==="queue"?u:parseInt(u,10):void 0}}}};function $a(r,e){let t=r.slice(e);if(t.startsWith("http://")||t.startsWith("https://")){let i=t.match(/^https?:\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("//")){let i=t.match(/^\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("./")||t.startsWith("../")){let i=t.match(/^\.\.?\/[^\s]*/);return i?i[0]:null}if(t.startsWith("/")){let i=t.match(/^\/[^\s]*/);return i?i[0]:null}return null}var Va=class{constructor(){this.name="url";}canExtract(r,e){let t=r.slice(e);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")||t.startsWith("./")||t.startsWith("../")||t.startsWith("/")}extract(r,e){let t=$a(r,e);return t?{value:t,length:t.length,metadata:{type:"url"}}:null}},qa=class{constructor(){this.name="variable-ref";}canExtract(r,e){return r[e]===":"&&e+1<r.length&&/[a-zA-Z_]/.test(r[e+1])}extract(r,e){if(!this.canExtract(r,e))return null;let t=1;for(;e+t<r.length&&/[a-zA-Z0-9_]/.test(r[e+t]);)t++;return {value:r.substring(e,e+t),length:t,metadata:{type:"variable-reference"}}}};function Wa(r){return {isLetter:i=>r.test(i),isIdentifierChar:i=>/[0-9]/.test(i)||r.test(i)}}var Ua=class{constructor(r,e,t){this.name=r;let i=Wa(e);this.isLetter=i.isLetter,this.isIdentifierChar=i.isIdentifierChar,this.prepositions=t;}setContext(r){this.context=r;}canExtract(r,e){return this.isLetter(r[e])}extract(r,e){if(!this.context)throw new Error(`${this.name}: context not set`);let t=e,i="";for(;t<r.length&&this.isIdentifierChar(r[t]);)i+=r[t++];if(!i)return null;let a=i.toLowerCase(),u=this.prepositions.has(a),n=this.context.lookupKeyword(a),o=n&&n.normalized!==n.native?n.normalized:void 0,s;if(!n&&this.context.normalizer){let l=this.context.normalizer.normalize(i);if(l.stem!==i&&l.confidence>=.7){let m=this.context.lookupKeyword(l.stem);m&&(s=m.normalized);}}return {value:i,length:t-e,metadata:{normalized:o||s,isPreposition:u}}}},Ka=new Set(["\u0432","\u0432\u043E","\u043D\u0430","\u0441","\u0441\u043E","\u043A","\u043A\u043E","\u043E","\u043E\u0431","\u043E\u0431\u043E","\u0443","\u043E\u0442","\u0434\u043E","\u0438\u0437","\u0437\u0430","\u043F\u043E","\u043F\u043E\u0434","\u043D\u0430\u0434","\u043F\u0435\u0440\u0435\u0434","\u043F\u0435\u0440\u0435\u0434\u043E","\u043C\u0435\u0436\u0434\u0443","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u0434\u043B\u044F","\u043F\u0440\u0438","\u043F\u0440\u043E","\u043F\u043E\u0441\u043B\u0435","\u0432\u043E\u043A\u0440\u0443\u0433","\u043F\u0440\u043E\u0442\u0438\u0432","\u0432\u043C\u0435\u0441\u0442\u043E","\u043A\u0440\u043E\u043C\u0435","\u0441\u0440\u0435\u0434\u0438"]);function Ga(){return [new Ua("russian-keyword",/[a-zA-Zа-яА-ЯёЁ]/,Ka)]}function Ha(r){let e=r.charCodeAt(0);return e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function Ya(r){let e=r.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}var Ja=class{constructor(){this.name="ascii-identifier";}setContext(r){this.context=r;}canExtract(r,e){return Ha(r[e])}extract(r,e){if(!this.context)throw new Error("AsciiIdentifierExtractor: context not set");let t=e,i="",a=e;for(;a<r.length&&Ya(r[a]);)i+=r[a],a++;if(!i)return null;let u=this.context.lookupKeyword(i),n=u&&u.normalized!==u.native?u.normalized:void 0;return {value:i,length:a-t,metadata:{normalized:n}}}};function Xa(){return [new Va,new La,new qa,new ja]}var Za=new Set(["\u0432","\u0432\u043E","\u043D\u0430","\u0441","\u0441\u043E","\u043A","\u043A\u043E","\u043E","\u043E\u0431","\u043E\u0431\u043E","\u0443","\u043E\u0442","\u0434\u043E","\u0438\u0437","\u0437\u0430","\u043F\u043E","\u043F\u043E\u0434","\u043D\u0430\u0434","\u043F\u0435\u0440\u0435\u0434","\u043F\u0435\u0440\u0435\u0434\u043E","\u043C\u0435\u0436\u0434\u0443","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u0434\u043B\u044F","\u043F\u0440\u0438","\u043F\u0440\u043E","\u043F\u043E\u0441\u043B\u0435","\u0432\u043E\u043A\u0440\u0443\u0433","\u043F\u0440\u043E\u0442\u0438\u0432","\u0432\u043C\u0435\u0441\u0442\u043E","\u043A\u0440\u043E\u043C\u0435","\u0441\u0440\u0435\u0434\u0438"]),Qa=[{native:"\u0438\u0441\u0442\u0438\u043D\u0430",normalized:"true"},{native:"\u043F\u0440\u0430\u0432\u0434\u0430",normalized:"true"},{native:"\u043B\u043E\u0436\u044C",normalized:"false"},{native:"null",normalized:"null"},{native:"\u043D\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u043E",normalized:"undefined"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",normalized:"s"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434\u044B",normalized:"s"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434",normalized:"s"},{native:"\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u0430",normalized:"ms"},{native:"\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434\u044B",normalized:"ms"},{native:"\u043C\u0438\u043B\u043B\u0438\u0441\u0435\u043A\u0443\u043D\u0434",normalized:"ms"},{native:"\u043C\u0438\u043D\u0443\u0442\u0430",normalized:"m"},{native:"\u043C\u0438\u043D\u0443\u0442\u044B",normalized:"m"},{native:"\u043C\u0438\u043D\u0443\u0442",normalized:"m"},{native:"\u0447\u0430\u0441",normalized:"h"},{native:"\u0447\u0430\u0441\u0430",normalized:"h"},{native:"\u0447\u0430\u0441\u043E\u0432",normalized:"h"},{native:"\u043F\u0435\u0440\u0432\u0430\u044F",normalized:"first"},{native:"\u043F\u0435\u0440\u0432\u043E\u0435",normalized:"first"},{native:"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F",normalized:"last"},{native:"\u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435",normalized:"last"},{native:"\u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F",normalized:"next"},{native:"\u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F",normalized:"previous"},{native:"\u043F\u0443\u0441\u0442\u0430\u044F",normalized:"empty"},{native:"\u043F\u0443\u0441\u0442\u043E\u0435",normalized:"empty"},{native:"\u043C\u043E\u044F",normalized:"my"},{native:"\u043C\u043E\u0451",normalized:"my"},{native:"\u043C\u043E\u0438",normalized:"my"}],eu=class extends K{constructor(){super(),this.language="ru",this.direction="ltr",this.initializeKeywordsFromProfile(hr,Qa),this.setNormalizer(new fr),this.registerExtractors([...Xa(),...Ga(),new W,new U,new Ja,new _a,new Ma]);}classifyToken(r){let e=r.toLowerCase();return Za.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(r)?"event-modifier":r.startsWith("#")||r.startsWith(".")||r.startsWith("[")||r.startsWith("*")||r.startsWith("<")?"selector":r.startsWith('"')||r.startsWith("'")||/^\d/.test(r)?"literal":"identifier"}},ru=new eu;J("ru",ru,hr);var Er={code:"pl",name:"Polish",nativeName:"Polski",direction:"ltr",script:"latin",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"imperative",verb:{position:"start",subjectDrop:true,suffixes:["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107"]},references:{me:"ja",it:"to",you:"ty",result:"wynik",event:"zdarzenie",target:"cel",body:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,specialForms:{me:"m\xF3j",it:"jego",you:"tw\xF3j"},keywords:{m\u00F3j:"me",moja:"me",moje:"me",tw\u00F3j:"you",twoja:"you",twoje:"you",jego:"it",jej:"it"}},roleMarkers:{destination:{primary:"do",alternatives:["w","na"],position:"before"},source:{primary:"z",alternatives:["od","ze"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"z",alternatives:["ze"],position:"before"}},keywords:{toggle:{primary:"prze\u0142\u0105cz",alternatives:["przelacz"],normalized:"toggle",form:"imperative"},add:{primary:"dodaj",normalized:"add",form:"imperative"},remove:{primary:"usu\u0144",alternatives:["usun","wyczy\u015B\u0107","wyczysc"],normalized:"remove",form:"imperative"},put:{primary:"umie\u015B\u0107",alternatives:["umiesc","wstaw"],normalized:"put",form:"imperative"},append:{primary:"do\u0142\u0105cz",alternatives:["dolacz"],normalized:"append",form:"imperative"},prepend:{primary:"poprzed\u017A",alternatives:["poprzedz"],normalized:"prepend",form:"imperative"},take:{primary:"we\u017A",alternatives:["wez"],normalized:"take",form:"imperative"},make:{primary:"utw\xF3rz",alternatives:["utworz","stw\xF3rz","stworz"],normalized:"make",form:"imperative"},clone:{primary:"sklonuj",normalized:"clone",form:"imperative"},swap:{primary:"zamie\u0144",alternatives:["zamien"],normalized:"swap",form:"imperative"},morph:{primary:"przekszta\u0142\u0107",alternatives:["przeksztalc"],normalized:"morph",form:"imperative"},set:{primary:"ustaw",alternatives:["okre\u015Bl","okresl"],normalized:"set",form:"imperative"},get:{primary:"uzyskaj",normalized:"get",form:"imperative"},increment:{primary:"zwi\u0119ksz",alternatives:["zwieksz"],normalized:"increment",form:"imperative"},decrement:{primary:"zmniejsz",normalized:"decrement",form:"imperative"},log:{primary:"loguj",alternatives:["wypisz"],normalized:"log",form:"imperative"},show:{primary:"poka\u017C",alternatives:["pokaz","wy\u015Bwietl","wyswietl"],normalized:"show",form:"imperative"},hide:{primary:"ukryj",alternatives:["schowaj"],normalized:"hide",form:"imperative"},transition:{primary:"animuj",alternatives:["przej\u015Bcie","przejscie"],normalized:"transition",form:"imperative"},on:{primary:"gdy",alternatives:["przy","na"],normalized:"on"},trigger:{primary:"wyzw\xF3l",alternatives:["wyzwol"],normalized:"trigger",form:"imperative"},send:{primary:"wy\u015Blij",alternatives:["wyslij"],normalized:"send",form:"imperative"},focus:{primary:"skup",alternatives:["skupienie"],normalized:"focus",form:"imperative"},blur:{primary:"rozmyj",alternatives:["odskup"],normalized:"blur",form:"imperative"},empty:{primary:"opr\xF3\u017Cnij",alternatives:["oproznij"],normalized:"empty"},open:{primary:"otw\xF3rz",alternatives:["otworz"],normalized:"open"},close:{primary:"zamknij",normalized:"close"},select:{primary:"zaznacz",normalized:"select"},clear:{primary:"zeruj",normalized:"clear"},reset:{primary:"zresetuj",normalized:"reset"},breakpoint:{primary:"punkt-przerwania",normalized:"breakpoint"},go:{primary:"id\u017A",alternatives:["idz","przejd\u017A","przejdz","nawiguj"],normalized:"go",form:"imperative"},scroll:{primary:"przewi\u0144",alternatives:["przewin"],normalized:"scroll",form:"imperative"},push:{primary:"wepchnij",alternatives:["push"],normalized:"push",form:"imperative"},replace:{primary:"nadpisz",alternatives:["zamie\u0144_url","zamien_url"],normalized:"replace",form:"imperative"},process:{primary:"przetw\xF3rz",alternatives:["przetworz"],normalized:"process",form:"imperative"},wait:{primary:"czekaj",alternatives:["poczekaj"],normalized:"wait",form:"imperative"},fetch:{primary:"pobierz",alternatives:["za\u0142aduj","zaladuj"],normalized:"fetch",form:"imperative"},settle:{primary:"ustabilizuj",normalized:"settle",form:"imperative"},if:{primary:"je\u015Bli",alternatives:["jesli","je\u017Celi","jezeli"],normalized:"if"},when:{primary:"kiedy",normalized:"when"},where:{primary:"gdzie",normalized:"where"},else:{primary:"inaczej",alternatives:["wpp"],normalized:"else"},repeat:{primary:"powt\xF3rz",alternatives:["powtorz"],normalized:"repeat",form:"imperative"},for:{primary:"dla",alternatives:["ka\u017Cdy","kazdy"],normalized:"for"},while:{primary:"dop\xF3ki",alternatives:["dopoki","podczas"],normalized:"while"},continue:{primary:"kontynuuj",alternatives:["dalej"],normalized:"continue",form:"imperative"},halt:{primary:"zatrzymaj",alternatives:["stop"],normalized:"halt",form:"imperative"},throw:{primary:"rzu\u0107",alternatives:["rzuc"],normalized:"throw",form:"imperative"},call:{primary:"wywo\u0142aj",alternatives:["wywolaj"],normalized:"call",form:"imperative"},return:{primary:"zwr\xF3\u0107",alternatives:["zwroc"],normalized:"return",form:"imperative"},then:{primary:"wtedy",alternatives:["potem","nast\u0119pnie","nastepnie"],normalized:"then"},and:{primary:"i",alternatives:["oraz"],normalized:"and"},end:{primary:"koniec",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"async",alternatives:["asynchronicznie"],normalized:"async"},tell:{primary:"powiedz",normalized:"tell",form:"imperative"},default:{primary:"domy\u015Blnie",alternatives:["domyslnie"],normalized:"default"},init:{primary:"inicjuj",normalized:"init",form:"imperative"},behavior:{primary:"zachowanie",normalized:"behavior"},install:{primary:"zainstaluj",normalized:"install",form:"imperative"},measure:{primary:"zmierz",normalized:"measure",form:"imperative"},beep:{primary:"sygna\u0142",normalized:"beep"},break:{primary:"przerwij",normalized:"break"},copy:{primary:"kopiuj",normalized:"copy"},exit:{primary:"wyjd\u017A",normalized:"exit"},pick:{primary:"wybierz",normalized:"pick"},render:{primary:"renderuj",normalized:"render"},into:{primary:"do",alternatives:["w"],normalized:"into"},before:{primary:"przed",normalized:"before"},after:{primary:"po",normalized:"after"},click:{primary:"klikni\u0119ciu",alternatives:["klikniecie","klik"],normalized:"click"},hover:{primary:"najechaniu",alternatives:["hover"],normalized:"hover"},submit:{primary:"wys\u0142aniu",alternatives:["wyslaniu","submit"],normalized:"submit"},input:{primary:"wprowadzeniu",alternatives:["input"],normalized:"input"},change:{primary:"zmianie",alternatives:["zmiana"],normalized:"change"},until:{primary:"a\u017C",alternatives:["az"],normalized:"until"},event:{primary:"zdarzenie",normalized:"event"},from:{primary:"z",alternatives:["od","ze"],normalized:"from"},connect:{primary:"po\u0142\u0105cz",alternatives:["pod\u0142\u0105cz"],normalized:"connect"},stream:{primary:"transmituj",alternatives:["strumie\u0144","streamuj"],normalized:"stream"},live:{primary:"na-\u017Cywo",alternatives:["na-bie\u017C\u0105co","live"],normalized:"live"},socket:{primary:"gniazdo",alternatives:["socket","websocket"],normalized:"socket"}},eventHandler:{keyword:{primary:"gdy",alternatives:["przy","na"],normalized:"on"},sourceMarker:{primary:"na",alternatives:["w","przy"],position:"before"},conditionalKeyword:{primary:"kiedy",alternatives:["gdy","je\u015Bli"]},eventMarker:{primary:"przy",alternatives:["na"],position:"before"},temporalMarkers:["kiedy","gdy","przy"]}},vr=new Map([["prze\u0142\u0105cz","prze\u0142\u0105cza\u0107"],["przelacz","przelaczac"],["dodaj","dodawa\u0107"],["usu\u0144","usuwa\u0107"],["usun","usuwac"],["umie\u015B\u0107","umieszcza\u0107"],["umiesc","umieszczac"],["wstaw","wstawia\u0107"],["ustaw","ustawia\u0107"],["pobierz","pobiera\u0107"],["we\u017A","bra\u0107"],["wez","brac"],["zwi\u0119ksz","zwi\u0119ksza\u0107"],["zwieksz","zwiekszac"],["zmniejsz","zmniejsza\u0107"],["poka\u017C","pokazywa\u0107"],["pokaz","pokazywac"],["ukryj","ukrywa\u0107"],["schowaj","schowywa\u0107"],["czekaj","czeka\u0107"],["poczekaj","poczeka\u0107"],["id\u017A","i\u015B\u0107"],["idz","isc"],["przejd\u017A","przej\u015B\u0107"],["przejdz","przejsc"],["wywo\u0142aj","wywo\u0142ywa\u0107"],["wywolaj","wywolywac"],["wy\u015Blij","wysy\u0142a\u0107"],["wyslij","wysylac"],["loguj","logowa\u0107"],["wypisz","wypisywa\u0107"],["sklonuj","sklonowa\u0107"],["kopiuj","kopiowa\u0107"],["zamie\u0144","zamienia\u0107"],["zamien","zamieniac"],["utw\xF3rz","tworzy\u0107"],["utworz","tworzyc"],["stw\xF3rz","stwarza\u0107"],["stworz","stwarzac"],["skup","skupia\u0107"],["rozmyj","rozmywa\u0107"],["nawiguj","nawigowa\u0107"],["za\u0142aduj","\u0142adowa\u0107"],["zaladuj","ladowac"],["powt\xF3rz","powtarza\u0107"],["powtorz","powtarzac"],["kontynuuj","kontynuowa\u0107"],["zatrzymaj","zatrzymywa\u0107"],["przerwij","przerywa\u0107"],["rzu\u0107","rzuca\u0107"],["rzuc","rzucac"],["zwr\xF3\u0107","zwraca\u0107"],["zwroc","zwracac"],["inicjuj","inicjowa\u0107"],["zainstaluj","instalowa\u0107"],["zmierz","mierzy\u0107"]]),gr=class{constructor(){this.language="pl";}isNormalizable(r){return r.length<3?false:/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/.test(r)}normalize(r){let e=r.toLowerCase();if(this.isInfinitive(e))return w(e);let t=this.tryImperativeNormalization(e);if(t)return t;let i=this.tryPastTenseNormalization(e);if(i)return i;let a=this.tryPresentTenseNormalization(e);return a||w(e)}isInfinitive(r){return ["a\u0107","e\u0107","i\u0107","y\u0107","\u0105\u0107","owa\u0107","iwa\u0107","ywa\u0107"].some(t=>r.endsWith(t))}tryImperativeNormalization(r){return vr.has(r)?y(vr.get(r),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):r.endsWith("aj")?y(r.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["aj"],conjugationType:"imperative"}):r.endsWith("uj")?y(r.slice(0,-2)+"owa\u0107",.8,{removedSuffixes:["uj"],conjugationType:"imperative"}):r.endsWith("ij")?y(r.slice(0,-2)+"i\u0107",.75,{removedSuffixes:["ij"],conjugationType:"imperative"}):null}tryPresentTenseNormalization(r){return r.endsWith("uj\u0119")||r.endsWith("uje")?y(r.slice(0,-3)+"owa\u0107",.85,{removedSuffixes:["uj\u0119"],conjugationType:"present"}):r.endsWith("am")&&r.length>3?y(r.slice(0,-2)+"a\u0107",.8,{removedSuffixes:["am"],conjugationType:"present"}):r.endsWith("em")&&r.length>3?y(r.slice(0,-2)+"e\u0107",.75,{removedSuffixes:["em"],conjugationType:"present"}):r.endsWith("\u0119")&&r.length>2?y(r.slice(0,-1)+"a\u0107",.7,{removedSuffixes:["\u0119"],conjugationType:"present"}):null}tryPastTenseNormalization(r){if(r.endsWith("a\u0142em")||r.endsWith("a\u0142am"))return y(r.slice(0,-4)+"a\u0107",.85,{removedSuffixes:[r.slice(-4)],conjugationType:"past"});if(r.endsWith("a\u0142")||r.endsWith("a\u0142a")){let e=r.endsWith("a\u0142a")?3:2;return y(r.slice(0,-e)+"a\u0107",.8,{removedSuffixes:[r.slice(-e)],conjugationType:"past"})}if(r.endsWith("i\u0142em")||r.endsWith("i\u0142am")||r.endsWith("ilem")||r.endsWith("ilam"))return y(r.slice(0,-4)+"i\u0107",.85,{removedSuffixes:[r.slice(-4)],conjugationType:"past"});if(r.endsWith("i\u0142")||r.endsWith("i\u0142a")||r.endsWith("il")||r.endsWith("ila")){let e=r.endsWith("i\u0142a")||r.endsWith("ila")?3:2;return y(r.slice(0,-e)+"i\u0107",.8,{removedSuffixes:[r.slice(-e)],conjugationType:"past"})}return null}},tu=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],iu=class{constructor(r=tu){this.name="operator",this.operators=[...r].sort((e,t)=>t.length-e.length);}canExtract(r,e){return this.operators.some(t=>r.startsWith(t,e))}extract(r,e){for(let t of this.operators)if(r.startsWith(t,e))return {value:t,length:t.length};return null}},au="()[]{},:;",uu=class{constructor(r=au){this.punctuation=r,this.name="punctuation";}canExtract(r,e){return this.punctuation.includes(r[e])}extract(r,e){let t=r[e];return this.punctuation.includes(t)?{value:t,length:1}:null}};function nu(r,e){let t=r[e];if(t==="#"){let i=r.slice(e).match(/^#[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="."){let i=r.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="["){let i=0,a=e;for(;a<r.length;){if(r[a]==="["&&i++,r[a]==="]"&&(i--,i===0))return r.slice(e,a+1);a++;}return null}if(t==="<"){let i=r.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return i?i[0]:null}return null}var ou=class{constructor(){this.name="css-selector";}canExtract(r,e){let t=r[e];return t==="#"||t==="."||t==="["||t==="<"}extract(r,e){let t=nu(r,e);return t?{value:t,length:t.length,metadata:{type:"css-selector"}}:null}},su=class{constructor(){this.name="event-modifier";}canExtract(r,e){if(r[e]!==".")return false;let t=r.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(t)}extract(r,e){let t=r.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!t)return null;let i=t[0],a=i.slice(1).split("(")[0],u=t[1];return {value:i,length:i.length,metadata:{modifierName:a,value:u?a==="queue"?u:parseInt(u,10):void 0}}}};function lu(r,e){let t=r.slice(e);if(t.startsWith("http://")||t.startsWith("https://")){let i=t.match(/^https?:\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("//")){let i=t.match(/^\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("./")||t.startsWith("../")){let i=t.match(/^\.\.?\/[^\s]*/);return i?i[0]:null}if(t.startsWith("/")){let i=t.match(/^\/[^\s]*/);return i?i[0]:null}return null}var mu=class{constructor(){this.name="url";}canExtract(r,e){let t=r.slice(e);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")||t.startsWith("./")||t.startsWith("../")||t.startsWith("/")}extract(r,e){let t=lu(r,e);return t?{value:t,length:t.length,metadata:{type:"url"}}:null}},cu=class{constructor(){this.name="variable-ref";}canExtract(r,e){return r[e]===":"&&e+1<r.length&&/[a-zA-Z_]/.test(r[e+1])}extract(r,e){if(!this.canExtract(r,e))return null;let t=1;for(;e+t<r.length&&/[a-zA-Z0-9_]/.test(r[e+t]);)t++;return {value:r.substring(e,e+t),length:t,metadata:{type:"variable-reference"}}}},pu=new Set(["do","od","z","ze","w","we","na","po","pod","przed","za","nad","mi\u0119dzy","miedzy","przez","dla","bez","o","przy","u","wed\u0142ug","wedlug","mimo","w\u015Br\xF3d","wsrod","obok","poza","wok\xF3\u0142","wokol","przeciw","ku"]);function du(){let r=/[a-zA-ZąęćńóśźżłĄĘĆŃÓŚŹŻŁ]/;return {isLetter:i=>r.test(i),isIdentifierChar:i=>/[0-9]/.test(i)||r.test(i)}}var{isLetter:yu,isIdentifierChar:fu}=du(),hu=class{constructor(){this.name="polish-keyword";}setContext(r){this.context=r;}canExtract(r,e){return yu(r[e])}extract(r,e){if(!this.context)throw new Error("PolishKeywordExtractor: context not set");let t=e,i="";for(;t<r.length&&fu(r[t]);)i+=r[t++];if(!i)return null;let a=i.toLowerCase(),u=pu.has(a),n=this.context.lookupKeyword(a),o=n&&n.normalized!==n.native?n.normalized:void 0,s;if(!n&&this.context.normalizer){let l=this.context.normalizer.normalize(i);if(l.stem!==i&&l.confidence>=.7){let m=this.context.lookupKeyword(l.stem);m&&(s=m.normalized);}}return {value:i,length:t-e,metadata:{normalized:o||s,isPreposition:u}}}};function vu(){return [new hu]}function Eu(){return [new mu,new su,new cu,new ou]}var gu=new Set(["do","od","z","ze","w","we","na","po","pod","przed","za","nad","mi\u0119dzy","miedzy","przez","dla","bez","o","przy","u","wed\u0142ug","wedlug","mimo","w\u015Br\xF3d","wsrod","obok","poza","wok\xF3\u0142","wokol","przeciw","ku"]),zu=[{native:"prawda",normalized:"true"},{native:"fa\u0142sz",normalized:"false"},{native:"falsz",normalized:"false"},{native:"null",normalized:"null"},{native:"nieokre\u015Blony",normalized:"undefined"},{native:"nieokreslony",normalized:"undefined"},{native:"pierwszy",normalized:"first"},{native:"pierwsza",normalized:"first"},{native:"pierwsze",normalized:"first"},{native:"ostatni",normalized:"last"},{native:"ostatnia",normalized:"last"},{native:"ostatnie",normalized:"last"},{native:"nast\u0119pny",normalized:"next"},{native:"nastepny",normalized:"next"},{native:"poprzedni",normalized:"previous"},{native:"najbli\u017Cszy",normalized:"closest"},{native:"najblizszy",normalized:"closest"},{native:"rodzic",normalized:"parent"},{native:"klikni\u0119cie",normalized:"click"},{native:"klikniecie",normalized:"click"},{native:"klik",normalized:"click"},{native:"click",normalized:"click"},{native:"zmiana",normalized:"change"},{native:"wys\u0142anie",normalized:"submit"},{native:"wyslanie",normalized:"submit"},{native:"naci\u015Bni\u0119cie",normalized:"keydown"},{native:"nacisniecie",normalized:"keydown"},{native:"klawisz",normalized:"keydown"},{native:"najechanie",normalized:"mouseover"},{native:"zjechanie",normalized:"mouseout"},{native:"rozmycie",normalized:"blur"},{native:"za\u0142adowanie",normalized:"load"},{native:"zaladowanie",normalized:"load"},{native:"przewini\u0119cie",normalized:"scroll"},{native:"przewiniecie",normalized:"scroll"},{native:"input",normalized:"input"},{native:"m\xF3j",normalized:"my"},{native:"moj",normalized:"my"},{native:"sekunda",normalized:"s"},{native:"sekundy",normalized:"s"},{native:"sekund",normalized:"s"},{native:"milisekunda",normalized:"ms"},{native:"milisekundy",normalized:"ms"},{native:"milisekund",normalized:"ms"},{native:"minuta",normalized:"m"},{native:"minuty",normalized:"m"},{native:"minut",normalized:"m"},{native:"godzina",normalized:"h"},{native:"godziny",normalized:"h"},{native:"godzin",normalized:"h"},{native:"po\u0142\xF3\u017C",normalized:"put"},{native:"poloz",normalized:"put"},{native:"lub",normalized:"or"},{native:"nie",normalized:"not"},{native:"jest",normalized:"is"},{native:"istnieje",normalized:"exists"},{native:"pusty",normalized:"empty"},{native:"puste",normalized:"empty"}],ku=class extends K{constructor(){super(),this.language="pl",this.direction="ltr",this.initializeKeywordsFromProfile(Er,zu),this.setNormalizer(new gr),this.registerExtractors(Eu()),this.registerExtractor(new W),this.registerExtractor(new U),this.registerExtractors(vu()),this.registerExtractor(new iu),this.registerExtractor(new uu);}classifyToken(r){let e=r.toLowerCase();return gu.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(r)?"event-modifier":r.startsWith("#")||r.startsWith(".")||r.startsWith("[")||r.startsWith("*")||r.startsWith("<")?"selector":r.startsWith('"')||r.startsWith("'")||/^\d/.test(r)?"literal":["==","!=","<=",">=","<",">","&&","||","!"].includes(r)?"operator":"identifier"}},Cu=new ku;J("pl",Cu,Er);function bu(r){return /[а-яА-ЯіІїЇєЄґҐьЬ']/.test(r)}var zr=new Map([["\u043F\u0435\u0440\u0435\u043C\u043A\u043D\u0438","\u043F\u0435\u0440\u0435\u043C\u043A\u043D\u0443\u0442\u0438"],["\u0434\u043E\u0434\u0430\u0439","\u0434\u043E\u0434\u0430\u0442\u0438"],["\u0432\u0438\u0434\u0430\u043B\u0438","\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438"],["\u043F\u0440\u0438\u0431\u0435\u0440\u0438","\u043F\u0440\u0438\u0431\u0440\u0430\u0442\u0438"],["\u043F\u043E\u043A\u043B\u0430\u0434\u0438","\u043F\u043E\u043A\u043B\u0430\u0441\u0442\u0438"],["\u043F\u043E\u043C\u0456\u0441\u0442\u0438","\u043F\u043E\u043C\u0456\u0441\u0442\u0438\u0442\u0438"],["\u0432\u0441\u0442\u0430\u0432","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438"],["\u0432\u0456\u0437\u044C\u043C\u0438","\u0432\u0437\u044F\u0442\u0438"],["\u0441\u0442\u0432\u043E\u0440\u0438","\u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438"],["\u043A\u043B\u043E\u043D\u0443\u0439","\u043A\u043B\u043E\u043D\u0443\u0432\u0430\u0442\u0438"],["\u043F\u043E\u043C\u0456\u043D\u044F\u0439","\u043F\u043E\u043C\u0456\u043D\u044F\u0442\u0438"],["\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0443\u0439","\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438","\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438"],["\u0437\u0430\u0434\u0430\u0439","\u0437\u0430\u0434\u0430\u0442\u0438"],["\u043E\u0442\u0440\u0438\u043C\u0430\u0439","\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438"],["\u0437\u0431\u0456\u043B\u044C\u0448","\u0437\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438"],["\u0437\u043C\u0435\u043D\u0448","\u0437\u043C\u0435\u043D\u0448\u0438\u0442\u0438"],["\u0437\u0430\u043F\u0438\u0448\u0438","\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u0438"],["\u043F\u043E\u043A\u0430\u0436\u0438","\u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0438"],["\u0441\u0445\u043E\u0432\u0430\u0439","\u0441\u0445\u043E\u0432\u0430\u0442\u0438"],["\u043F\u0440\u0438\u0445\u043E\u0432\u0430\u0439","\u043F\u0440\u0438\u0445\u043E\u0432\u0430\u0442\u0438"],["\u0430\u043D\u0456\u043C\u0443\u0439","\u0430\u043D\u0456\u043C\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0438\u043A\u043B\u0438\u0447","\u0432\u0438\u043A\u043B\u0438\u043A\u0430\u0442\u0438"],["\u043D\u0430\u0434\u0456\u0448\u043B\u0438","\u043D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438"],["\u0441\u0444\u043E\u043A\u0443\u0441\u0443\u0439","\u0441\u0444\u043E\u043A\u0443\u0441\u0443\u0432\u0430\u0442\u0438"],["\u0440\u043E\u0437\u0444\u043E\u043A\u0443\u0441\u0443\u0439","\u0440\u043E\u0437\u0444\u043E\u043A\u0443\u0441\u0443\u0432\u0430\u0442\u0438"],["\u043F\u0435\u0440\u0435\u0439\u0434\u0438","\u043F\u0435\u0440\u0435\u0439\u0442\u0438"],["\u0439\u0434\u0438","\u0439\u0442\u0438"],["\u0447\u0435\u043A\u0430\u0439","\u0447\u0435\u043A\u0430\u0442\u0438"],["\u0437\u0430\u0447\u0435\u043A\u0430\u0439","\u0437\u0430\u0447\u0435\u043A\u0430\u0442\u0438"],["\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436","\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438"],["\u043F\u043E\u0432\u0442\u043E\u0440\u0438","\u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438"],["\u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0443\u0439","\u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438"],["\u043A\u0438\u043D\u044C","\u043A\u0438\u043D\u0443\u0442\u0438"],["\u043F\u043E\u0432\u0435\u0440\u043D\u0438","\u043F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438"],["\u0441\u043A\u0430\u0436\u0438","\u0441\u043A\u0430\u0437\u0430\u0442\u0438"],["\u0456\u043D\u0456\u0446\u0456\u0430\u043B\u0456\u0437\u0443\u0439","\u0456\u043D\u0456\u0446\u0456\u0430\u043B\u0456\u0437\u0443\u0432\u0430\u0442\u0438"],["\u0432\u0438\u043C\u0456\u0440\u044F\u0439","\u0432\u0438\u043C\u0456\u0440\u044F\u0442\u0438"]]),kr=class{constructor(){this.language="uk";}isNormalizable(r){return r.length<3?false:bu(r)}normalize(r){let e=r.toLowerCase();if(e.endsWith("\u0441\u044F")||e.endsWith("\u0441\u044C")){let n=this.tryReflexiveNormalization(e);if(n)return n}if(e.endsWith("\u0442\u0438")||e.endsWith("\u0447\u0438"))return w(r);let t=this.tryImperativeLookup(e);if(t)return t;let i=this.tryPastTenseNormalization(e);if(i)return i;let a=this.tryPresentTenseNormalization(e);if(a)return a;let u=this.tryGenericImperativeNormalization(e);return u||w(r)}tryReflexiveNormalization(r){let e=r.slice(0,-2);if(r.endsWith("\u0442\u0438\u0441\u044F")||r.endsWith("\u0447\u0438\u0441\u044F"))return w(r);let t=this.normalizeNonReflexive(e);if(t.confidence<1){let i=t.stem.endsWith("\u0442\u0438")?t.stem.slice(0,-2)+"\u0442\u0438\u0441\u044F":t.stem+"\u0441\u044F";return y(i,t.confidence*.95,{removedSuffixes:["\u0441\u044F",...t.metadata?.removedSuffixes||[]],conjugationType:"reflexive"})}return null}normalizeNonReflexive(r){if(r.endsWith("\u0442\u0438")||r.endsWith("\u0447\u0438"))return w(r);let e=this.tryImperativeLookup(r);if(e)return e;let t=this.tryPastTenseNormalization(r);if(t)return t;let i=this.tryPresentTenseNormalization(r);if(i)return i;let a=this.tryGenericImperativeNormalization(r);return a||w(r)}tryImperativeLookup(r){return zr.has(r)?y(zr.get(r),.95,{removedSuffixes:["imperative"],conjugationType:"imperative"}):null}tryGenericImperativeNormalization(r){return r.endsWith("\u0439\u0442\u0435")&&r.length>5?y(r.slice(0,-3)+"\u0442\u0438",.8,{removedSuffixes:["\u0439\u0442\u0435"],conjugationType:"imperative"}):r.endsWith("\u0456\u0442\u044C")&&r.length>5?y(r.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0456\u0442\u044C"],conjugationType:"imperative"}):r.endsWith("\u0439")&&r.length>3?y(r.slice(0,-1)+"\u0442\u0438",.75,{removedSuffixes:["\u0439"],conjugationType:"imperative"}):r.endsWith("\u0438")&&r.length>3?y(r+"\u0442\u0438",.7,{removedSuffixes:["\u0438\u2192\u0438\u0442\u0438"],conjugationType:"imperative"}):null}tryPastTenseNormalization(r){return r.endsWith("\u0430\u043B\u0430")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0430"],conjugationType:"past"}):r.endsWith("\u0438\u043B\u0430")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0430"],conjugationType:"past"}):r.endsWith("\u0430\u043B\u0438")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u0438",.85,{removedSuffixes:["\u0430\u043B\u0438"],conjugationType:"past"}):r.endsWith("\u0438\u043B\u0438")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u0438",.85,{removedSuffixes:["\u0438\u043B\u0438"],conjugationType:"past"}):r.endsWith("\u0430\u0432")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u0438",.82,{removedSuffixes:["\u0430\u0432"],conjugationType:"past"}):r.endsWith("\u0438\u0432")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u0438",.82,{removedSuffixes:["\u0438\u0432"],conjugationType:"past"}):null}tryPresentTenseNormalization(r){return r.endsWith("\u0438\u0448")&&r.length>3?y(r.slice(0,-2)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u0448"],conjugationType:"present"}):r.endsWith("\u0438\u0442\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u0438\u0442\u044C"],conjugationType:"present"}):r.endsWith("\u0438\u043C\u043E")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u0438",.8,{removedSuffixes:["\u0438\u043C\u043E"],conjugationType:"present"}):r.endsWith("\u044F\u0442\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0438\u0442\u0438",.78,{removedSuffixes:["\u044F\u0442\u044C"],conjugationType:"present"}):r.endsWith("\u0454\u0448")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u0454\u0448"],conjugationType:"present"}):r.endsWith("\u0435\u0448")&&r.length>3?y(r.slice(0,-2)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0435\u0448"],conjugationType:"present"}):r.endsWith("\u0454")&&r.length>2?y(r.slice(0,-1)+"\u0430\u0442\u0438",.72,{removedSuffixes:["\u0454"],conjugationType:"present"}):r.endsWith("\u0454\u043C\u043E")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u0438",.8,{removedSuffixes:["\u0454\u043C\u043E"],conjugationType:"present"}):r.endsWith("\u044E\u0442\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u0438",.78,{removedSuffixes:["\u044E\u0442\u044C"],conjugationType:"present"}):r.endsWith("\u0443\u0442\u044C")&&r.length>4?y(r.slice(0,-3)+"\u0430\u0442\u0438",.75,{removedSuffixes:["\u0443\u0442\u044C"],conjugationType:"present"}):null}},Cr={code:"uk",name:"Ukrainian",nativeName:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",direction:"ltr",script:"cyrillic",wordOrder:"SVO",markingStrategy:"preposition",usesSpaces:true,defaultVerbForm:"infinitive",verb:{position:"start",subjectDrop:true,suffixes:["\u0442\u0438","\u0442\u0438\u0441\u044F","\u0438\u0442\u0438","\u0438\u0442\u0438\u0441\u044F","\u0430\u0442\u0438","\u0430\u0442\u0438\u0441\u044F","\u0456\u0442\u0438","\u0456\u0442\u0438\u0441\u044F"]},references:{me:"\u044F",it:"\u0446\u0435",you:"\u0442\u0438",result:"\u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442",event:"\u043F\u043E\u0434\u0456\u044F",target:"\u0446\u0456\u043B\u044C",body:"body"},possessive:{marker:"",markerPosition:"after-object",usePossessiveAdjectives:true,specialForms:{me:"\u043C\u0456\u0439",it:"\u0439\u043E\u0433\u043E",you:"\u0442\u0432\u0456\u0439"},keywords:{\u043C\u0456\u0439:"me",\u043C\u043E\u044F:"me",\u043C\u043E\u0454:"me",\u043C\u043E\u0457:"me",\u0442\u0432\u0456\u0439:"you",\u0442\u0432\u043E\u044F:"you",\u0442\u0432\u043E\u0454:"you",\u0442\u0432\u043E\u0457:"you",\u0439\u043E\u0433\u043E:"it",\u0457\u0457:"it"}},roleMarkers:{destination:{primary:"\u0432",alternatives:["\u043D\u0430","\u0434\u043E"],position:"before"},source:{primary:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"],position:"before"},patient:{primary:"",position:"before"},style:{primary:"\u0437",alternatives:["\u0456\u0437"],position:"before"}},keywords:{toggle:{primary:"\u043F\u0435\u0440\u0435\u043C\u043A\u043D\u0443\u0442\u0438",alternatives:["\u043F\u0435\u0440\u0435\u043C\u043A\u043D\u0438"],normalized:"toggle",form:"infinitive"},add:{primary:"\u0434\u043E\u0434\u0430\u0442\u0438",alternatives:["\u0434\u043E\u0434\u0430\u0439"],normalized:"add",form:"infinitive"},remove:{primary:"\u0432\u0438\u0434\u0430\u043B\u0438\u0442\u0438",alternatives:["\u0432\u0438\u0434\u0430\u043B\u0438","\u043F\u0440\u0438\u0431\u0440\u0430\u0442\u0438","\u043F\u0440\u0438\u0431\u0435\u0440\u0438"],normalized:"remove",form:"infinitive"},put:{primary:"\u043F\u043E\u043A\u043B\u0430\u0441\u0442\u0438",alternatives:["\u043F\u043E\u043A\u043B\u0430\u0434\u0438","\u043F\u043E\u043C\u0456\u0441\u0442\u0438\u0442\u0438","\u043F\u043E\u043C\u0456\u0441\u0442\u0438","\u0432\u0441\u0442\u0430\u0432\u0438\u0442\u0438","\u0432\u0441\u0442\u0430\u0432"],normalized:"put",form:"infinitive"},append:{primary:"\u0434\u043E\u0434\u0430\u0442\u0438_\u0432_\u043A\u0456\u043D\u0435\u0446\u044C",alternatives:["\u0434\u043E\u043F\u0438\u0441\u0430\u0442\u0438"],normalized:"append",form:"infinitive"},prepend:{primary:"\u0434\u043E\u0434\u0430\u0442\u0438_\u043D\u0430_\u043F\u043E\u0447\u0430\u0442\u043E\u043A",normalized:"prepend",form:"infinitive"},take:{primary:"\u0432\u0437\u044F\u0442\u0438",alternatives:["\u0432\u0456\u0437\u044C\u043C\u0438"],normalized:"take",form:"infinitive"},make:{primary:"\u0441\u0442\u0432\u043E\u0440\u0438\u0442\u0438",alternatives:["\u0441\u0442\u0432\u043E\u0440\u0438"],normalized:"make",form:"infinitive"},clone:{primary:"\u043A\u043B\u043E\u043D\u0443\u0432\u0430\u0442\u0438",alternatives:["\u043A\u043B\u043E\u043D\u0443\u0439"],normalized:"clone",form:"infinitive"},swap:{primary:"\u043F\u043E\u043C\u0456\u043D\u044F\u0442\u0438",alternatives:["\u043F\u043E\u043C\u0456\u043D\u044F\u0439"],normalized:"swap",form:"infinitive"},morph:{primary:"\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0442\u0440\u0430\u043D\u0441\u0444\u043E\u0440\u043C\u0443\u0439"],normalized:"morph",form:"infinitive"},set:{primary:"\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438",alternatives:["\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438","\u0437\u0430\u0434\u0430\u0442\u0438","\u0437\u0430\u0434\u0430\u0439"],normalized:"set",form:"infinitive"},get:{primary:"\u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438",alternatives:["\u043E\u0442\u0440\u0438\u043C\u0430\u0439"],normalized:"get",form:"infinitive"},increment:{primary:"\u0437\u0431\u0456\u043B\u044C\u0448\u0438\u0442\u0438",alternatives:["\u0437\u0431\u0456\u043B\u044C\u0448"],normalized:"increment",form:"infinitive"},decrement:{primary:"\u0437\u043C\u0435\u043D\u0448\u0438\u0442\u0438",alternatives:["\u0437\u043C\u0435\u043D\u0448"],normalized:"decrement",form:"infinitive"},log:{primary:"\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u0438",alternatives:["\u0437\u0430\u043F\u0438\u0448\u0438"],normalized:"log",form:"infinitive"},show:{primary:"\u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0438",alternatives:["\u043F\u043E\u043A\u0430\u0436\u0438"],normalized:"show",form:"infinitive"},hide:{primary:"\u0441\u0445\u043E\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0445\u043E\u0432\u0430\u0439","\u043F\u0440\u0438\u0445\u043E\u0432\u0430\u0442\u0438","\u043F\u0440\u0438\u0445\u043E\u0432\u0430\u0439"],normalized:"hide",form:"infinitive"},transition:{primary:"\u0430\u043D\u0456\u043C\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0430\u043D\u0456\u043C\u0443\u0439"],normalized:"transition",form:"infinitive"},on:{primary:"\u043F\u0440\u0438",normalized:"on"},trigger:{primary:"\u0456\u043D\u0456\u0446\u0456\u044E\u0432\u0430\u0442\u0438",alternatives:["\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0438","\u0437\u0430\u043F\u0443\u0441\u0442\u0438"],normalized:"trigger",form:"infinitive"},send:{primary:"\u043D\u0430\u0434\u0456\u0441\u043B\u0430\u0442\u0438",alternatives:["\u043D\u0430\u0434\u0456\u0448\u043B\u0438"],normalized:"send",form:"infinitive"},focus:{primary:"\u0441\u0444\u043E\u043A\u0443\u0441\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0441\u0444\u043E\u043A\u0443\u0441\u0443\u0439","\u0444\u043E\u043A\u0443\u0441"],normalized:"focus",form:"infinitive"},blur:{primary:"\u0440\u043E\u0437\u0444\u043E\u043A\u0443\u0441\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0440\u043E\u0437\u0444\u043E\u043A\u0443\u0441\u0443\u0439"],normalized:"blur",form:"infinitive"},empty:{primary:"\u0441\u043F\u043E\u0440\u043E\u0436\u043D\u0438\u0442\u0438",normalized:"empty"},open:{primary:"\u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438",normalized:"open"},close:{primary:"\u0437\u0430\u043A\u0440\u0438\u0442\u0438",normalized:"close"},select:{primary:"\u0432\u0438\u0434\u0456\u043B\u0438\u0442\u0438",normalized:"select"},clear:{primary:"\u043E\u0447\u0438\u0441\u0442\u0438\u0442\u0438",normalized:"clear"},reset:{primary:"\u0441\u043A\u0438\u043D\u0443\u0442\u0438",normalized:"reset"},breakpoint:{primary:"\u0442\u043E\u0447\u043A\u0430-\u0437\u0443\u043F\u0438\u043D\u043A\u0438",normalized:"breakpoint"},click:{primary:"\u043A\u043B\u0456\u043A\u0443",alternatives:["\u043A\u043B\u0456\u043A","\u043D\u0430\u0442\u0438\u0441\u043A\u0430\u043D\u043D\u0456"],normalized:"click"},hover:{primary:"\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043D\u0456",alternatives:["\u043D\u0430\u0432\u0435\u0434\u0435\u043D\u043D\u044F"],normalized:"hover"},submit:{primary:"\u0432\u0456\u0434\u043F\u0440\u0430\u0432\u0446\u0456",alternatives:["\u0432\u0456\u0434\u043F\u0440\u0430\u0432\u043A\u0430"],normalized:"submit"},input:{primary:"\u0432\u0432\u0435\u0434\u0435\u043D\u043D\u0456",alternatives:["\u0432\u0432\u0435\u0434\u0435\u043D\u043D\u044F"],normalized:"input"},change:{primary:"\u0437\u043C\u0456\u043D\u0456",alternatives:["\u0437\u043C\u0456\u043D\u0430"],normalized:"change"},go:{primary:"\u043F\u0435\u0440\u0435\u0439\u0442\u0438",alternatives:["\u043F\u0435\u0440\u0435\u0439\u0434\u0438","\u0439\u0442\u0438","\u0439\u0434\u0438"],normalized:"go",form:"infinitive"},scroll:{primary:"\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u0438\u0442\u0438",alternatives:["\u043F\u0440\u043E\u043A\u0440\u0443\u0442\u0438"],normalized:"scroll",form:"infinitive"},push:{primary:"\u0448\u0442\u043E\u0432\u0445\u043D\u0443\u0442\u0438",alternatives:["\u0437\u0430\u0448\u0442\u043E\u0432\u0445\u043D\u0443\u0442\u0438"],normalized:"push",form:"infinitive"},replace:{primary:"\u0437\u0430\u043C\u0456\u043D\u0438\u0442\u0438",alternatives:["\u0437\u0430\u043C\u0456\u043D\u0438"],normalized:"replace",form:"infinitive"},process:{primary:"\u043E\u0431\u0440\u043E\u0431\u0438\u0442\u0438",alternatives:["\u043E\u0431\u0440\u043E\u0431\u043B\u044F\u0442\u0438"],normalized:"process",form:"infinitive"},wait:{primary:"\u0447\u0435\u043A\u0430\u0442\u0438",alternatives:["\u0447\u0435\u043A\u0430\u0439","\u0437\u0430\u0447\u0435\u043A\u0430\u0439"],normalized:"wait",form:"infinitive"},fetch:{primary:"\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438",alternatives:["\u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436"],normalized:"fetch",form:"infinitive"},settle:{primary:"\u0441\u0442\u0430\u0431\u0456\u043B\u0456\u0437\u0443\u0432\u0430\u0442\u0438",normalized:"settle",form:"infinitive"},if:{primary:"\u044F\u043A\u0449\u043E",normalized:"if"},when:{primary:"\u043A\u043E\u043B\u0438",normalized:"when"},where:{primary:"\u0434\u0435",normalized:"where"},else:{primary:"\u0456\u043D\u0430\u043A\u0448\u0435",normalized:"else"},repeat:{primary:"\u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438",alternatives:["\u043F\u043E\u0432\u0442\u043E\u0440\u0438"],normalized:"repeat",form:"infinitive"},for:{primary:"\u0434\u043B\u044F",alternatives:["\u043A\u043E\u0436\u043D\u0438\u0439"],normalized:"for"},while:{primary:"\u043F\u043E\u043A\u0438",normalized:"while"},continue:{primary:"\u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438",alternatives:["\u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0443\u0439"],normalized:"continue",form:"infinitive"},halt:{primary:"\u0437\u0443\u043F\u0438\u043D\u0438\u0442\u0438",alternatives:["\u0437\u0443\u043F\u0438\u043D\u0438\u0441\u044C","\u0441\u0442\u043E\u043F"],normalized:"halt",form:"infinitive"},throw:{primary:"\u043A\u0438\u043D\u0443\u0442\u0438",alternatives:["\u043A\u0438\u043D\u044C"],normalized:"throw",form:"infinitive"},call:{primary:"\u0432\u0438\u043A\u043B\u0438\u043A\u0430\u0442\u0438",alternatives:["\u0432\u0438\u043A\u043B\u0438\u0447"],normalized:"call",form:"infinitive"},return:{primary:"\u043F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438",alternatives:["\u043F\u043E\u0432\u0435\u0440\u043D\u0438"],normalized:"return",form:"infinitive"},then:{primary:"\u043F\u043E\u0442\u0456\u043C",alternatives:["\u0434\u0430\u043B\u0456","\u0442\u043E\u0434\u0456"],normalized:"then"},and:{primary:"\u0456",alternatives:["\u0442\u0430"],normalized:"and"},end:{primary:"\u043A\u0456\u043D\u0435\u0446\u044C",normalized:"end"},js:{primary:"js",normalized:"js"},async:{primary:"\u0430\u0441\u0438\u043D\u0445\u0440\u043E\u043D\u043D\u043E",alternatives:["async"],normalized:"async"},tell:{primary:"\u0441\u043A\u0430\u0437\u0430\u0442\u0438",alternatives:["\u0441\u043A\u0430\u0436\u0438"],normalized:"tell",form:"infinitive"},default:{primary:"\u0437\u0430_\u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\u044F\u043C",normalized:"default"},init:{primary:"\u0456\u043D\u0456\u0446\u0456\u0430\u043B\u0456\u0437\u0443\u0432\u0430\u0442\u0438",alternatives:["\u0456\u043D\u0456\u0446\u0456\u0430\u043B\u0456\u0437\u0443\u0439"],normalized:"init",form:"infinitive"},behavior:{primary:"\u043F\u043E\u0432\u0435\u0434\u0456\u043D\u043A\u0430",normalized:"behavior"},install:{primary:"\u0432\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0438_\u043F\u0430\u043A\u0435\u0442",normalized:"install",form:"infinitive"},measure:{primary:"\u0432\u0438\u043C\u0456\u0440\u044F\u0442\u0438",alternatives:["\u0432\u0438\u043C\u0456\u0440\u044F\u0439"],normalized:"measure",form:"infinitive"},beep:{primary:"\u0437\u0432\u0443\u043A",normalized:"beep"},break:{primary:"\u043F\u0435\u0440\u0435\u0440\u0432\u0430\u0442\u0438",normalized:"break"},copy:{primary:"\u043A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438",normalized:"copy"},exit:{primary:"\u0432\u0438\u0439\u0442\u0438",normalized:"exit"},pick:{primary:"\u0432\u0438\u0431\u0440\u0430\u0442\u0438",normalized:"pick"},render:{primary:"\u0432\u0456\u0434\u043E\u0431\u0440\u0430\u0437\u0438\u0442\u0438",normalized:"render"},into:{primary:"\u0432",alternatives:["\u0443"],normalized:"into"},before:{primary:"\u0434\u043E",alternatives:["\u043F\u0435\u0440\u0435\u0434"],normalized:"before"},after:{primary:"\u043F\u0456\u0441\u043B\u044F",normalized:"after"},until:{primary:"\u043F\u043E\u043A\u0438_\u043D\u0435",normalized:"until"},event:{primary:"\u043F\u043E\u0434\u0456\u044F",normalized:"event"},from:{primary:"\u0437",alternatives:["\u0432\u0456\u0434","\u0456\u0437"],normalized:"from"},connect:{primary:"\u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438",alternatives:["\u0437\u02BC\u0454\u0434\u043D\u0430\u0442\u0438","\u043F\u0456\u0434\u043A\u043B\u044E\u0447\u0438\u0442\u0438\u0441\u044F"],normalized:"connect"},stream:{primary:"\u0442\u0440\u0430\u043D\u0441\u043B\u044E\u0432\u0430\u0442\u0438",alternatives:["\u043F\u043E\u0442\u0456\u043A","\u0441\u0442\u0440\u0456\u043C"],normalized:"stream"},live:{primary:"\u043D\u0430\u0436\u0438\u0432\u043E",alternatives:["\u0443-\u043F\u0440\u044F\u043C\u043E\u043C\u0443-\u0435\u0444\u0456\u0440\u0456","\u0432-\u0440\u0435\u0436\u0438\u043C\u0456-\u0440\u0435\u0430\u043B\u044C\u043D\u043E\u0433\u043E-\u0447\u0430\u0441\u0443"],normalized:"live"},socket:{primary:"\u0441\u043E\u043A\u0435\u0442",alternatives:["\u0433\u043D\u0456\u0437\u0434\u043E","websocket"],normalized:"socket"}},eventHandler:{keyword:{primary:"\u043F\u0440\u0438",normalized:"on"},sourceMarker:{primary:"\u043D\u0430",alternatives:["\u0432","\u043F\u0440\u0438"],position:"before"},eventMarker:{primary:"\u043F\u0440\u0438",position:"before"},temporalMarkers:["\u043A\u043E\u043B\u0438","\u044F\u043A\u0449\u043E"]}},Au=["===","!==","->","==","!=","<=",">=","&&","||","**","+=","-=","*=","/=","+","-","*","/","=",">","<","!","&","|","%","^","~"],wu=class{constructor(r=Au){this.name="operator",this.operators=[...r].sort((e,t)=>t.length-e.length);}canExtract(r,e){return this.operators.some(t=>r.startsWith(t,e))}extract(r,e){for(let t of this.operators)if(r.startsWith(t,e))return {value:t,length:t.length};return null}},Du="()[]{},:;",xu=class{constructor(r=Du){this.punctuation=r,this.name="punctuation";}canExtract(r,e){return this.punctuation.includes(r[e])}extract(r,e){let t=r[e];return this.punctuation.includes(t)?{value:t,length:1}:null}};function Bu(r,e){let t=r[e];if(t==="#"){let i=r.slice(e).match(/^#[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="."){let i=r.slice(e).match(/^\.[a-zA-Z_][\w-]*/);return i?i[0]:null}if(t==="["){let i=0,a=e;for(;a<r.length;){if(r[a]==="["&&i++,r[a]==="]"&&(i--,i===0))return r.slice(e,a+1);a++;}return null}if(t==="<"){let i=r.slice(e).match(/^<[\w-]+(?:[#.][\w-]+|\[[^\]]+\])*\s*\/>/);return i?i[0]:null}return null}var Fu=class{constructor(){this.name="css-selector";}canExtract(r,e){let t=r[e];return t==="#"||t==="."||t==="["||t==="<"}extract(r,e){let t=Bu(r,e);return t?{value:t,length:t.length,metadata:{type:"css-selector"}}:null}},Su=class{constructor(){this.name="event-modifier";}canExtract(r,e){if(r[e]!==".")return false;let t=r.slice(e);return /^\.(once|prevent|stop|debounce|throttle|queue)/.test(t)}extract(r,e){let t=r.slice(e).match(/^\.(?:once|prevent|stop|debounce|throttle|queue)(?:\(([^)]+)\))?/);if(!t)return null;let i=t[0],a=i.slice(1).split("(")[0],u=t[1];return {value:i,length:i.length,metadata:{modifierName:a,value:u?a==="queue"?u:parseInt(u,10):void 0}}}};function Tu(r,e){let t=r.slice(e);if(t.startsWith("http://")||t.startsWith("https://")){let i=t.match(/^https?:\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("//")){let i=t.match(/^\/\/[^\s]*/);return i?i[0]:null}if(t.startsWith("./")||t.startsWith("../")){let i=t.match(/^\.\.?\/[^\s]*/);return i?i[0]:null}if(t.startsWith("/")){let i=t.match(/^\/[^\s]*/);return i?i[0]:null}return null}var Pu=class{constructor(){this.name="url";}canExtract(r,e){let t=r.slice(e);return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//")||t.startsWith("./")||t.startsWith("../")||t.startsWith("/")}extract(r,e){let t=Tu(r,e);return t?{value:t,length:t.length,metadata:{type:"url"}}:null}},Ru=class{constructor(){this.name="variable-ref";}canExtract(r,e){return r[e]===":"&&e+1<r.length&&/[a-zA-Z_]/.test(r[e+1])}extract(r,e){if(!this.canExtract(r,e))return null;let t=1;for(;e+t<r.length&&/[a-zA-Z0-9_]/.test(r[e+t]);)t++;return {value:r.substring(e,e+t),length:t,metadata:{type:"variable-reference"}}}};function Nu(r){return {isLetter:i=>r.test(i),isIdentifierChar:i=>/[0-9]/.test(i)||r.test(i)}}var _u=class{constructor(r,e,t){this.name=r;let i=Nu(e);this.isLetter=i.isLetter,this.isIdentifierChar=i.isIdentifierChar,this.prepositions=t;}setContext(r){this.context=r;}canExtract(r,e){return this.isLetter(r[e])}extract(r,e){if(!this.context)throw new Error(`${this.name}: context not set`);let t=e,i="";for(;t<r.length&&this.isIdentifierChar(r[t]);)i+=r[t++];if(!i)return null;let a=i.toLowerCase(),u=this.prepositions.has(a),n=this.context.lookupKeyword(a),o=n&&n.normalized!==n.native?n.normalized:void 0,s;if(!n&&this.context.normalizer){let l=this.context.normalizer.normalize(i);if(l.stem!==i&&l.confidence>=.7){let m=this.context.lookupKeyword(l.stem);m&&(s=m.normalized);}}return {value:i,length:t-e,metadata:{normalized:o||s,isPreposition:u}}}},Ou=new Set(["\u0432","\u0443","\u043D\u0430","\u0437","\u0456\u0437","\u0437\u0456","\u0434\u043E","\u0432\u0456\u0434","\u043E","\u043E\u0431","\u043F\u0440\u0438","\u0434\u043B\u044F","\u043F\u0456\u0434","\u043D\u0430\u0434","\u043F\u0435\u0440\u0435\u0434","\u043C\u0456\u0436","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u043F\u043E","\u0437\u0430","\u043F\u0440\u043E","\u043F\u0456\u0441\u043B\u044F","\u043D\u0430\u0432\u043A\u043E\u043B\u043E","\u043F\u0440\u043E\u0442\u0438","\u0437\u0430\u043C\u0456\u0441\u0442\u044C","\u043A\u0440\u0456\u043C","\u0441\u0435\u0440\u0435\u0434","\u043A"]);function Mu(){return [new _u("ukrainian-keyword",/[a-zA-Zа-яА-ЯіІїЇєЄґҐьЬ']/,Ou)]}function Iu(r){let e=r.charCodeAt(0);return e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}function ju(r){let e=r.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e===36}var Lu=class{constructor(){this.name="ascii-identifier";}setContext(r){this.context=r;}canExtract(r,e){return Iu(r[e])}extract(r,e){if(!this.context)throw new Error("AsciiIdentifierExtractor: context not set");let t=e,i="",a=e;for(;a<r.length&&ju(r[a]);)i+=r[a],a++;if(!i)return null;let u=this.context.lookupKeyword(i),n=u&&u.normalized!==u.native?u.normalized:void 0;return {value:i,length:a-t,metadata:{normalized:n}}}};function $u(){return [new Pu,new Su,new Ru,new Fu]}var Vu=new Set(["\u0432","\u0443","\u043D\u0430","\u0437","\u0456\u0437","\u0437\u0456","\u0434\u043E","\u0432\u0456\u0434","\u043E","\u043E\u0431","\u043F\u0440\u0438","\u0434\u043B\u044F","\u043F\u0456\u0434","\u043D\u0430\u0434","\u043F\u0435\u0440\u0435\u0434","\u043C\u0456\u0436","\u0447\u0435\u0440\u0435\u0437","\u0431\u0435\u0437","\u043F\u043E","\u0437\u0430","\u043F\u0440\u043E","\u043F\u0456\u0441\u043B\u044F","\u043D\u0430\u0432\u043A\u043E\u043B\u043E","\u043F\u0440\u043E\u0442\u0438","\u0437\u0430\u043C\u0456\u0441\u0442\u044C","\u043A\u0440\u0456\u043C","\u0441\u0435\u0440\u0435\u0434","\u043A"]),qu=[{native:"\u0456\u0441\u0442\u0438\u043D\u0430",normalized:"true"},{native:"\u043F\u0440\u0430\u0432\u0434\u0430",normalized:"true"},{native:"\u0445\u0438\u0431\u043D\u0456\u0441\u0442\u044C",normalized:"false"},{native:"null",normalized:"null"},{native:"\u043D\u0435\u0432\u0438\u0437\u043D\u0430\u0447\u0435\u043D\u043E",normalized:"undefined"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434\u0430",normalized:"s"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434\u0438",normalized:"s"},{native:"\u0441\u0435\u043A\u0443\u043D\u0434",normalized:"s"},{native:"\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0430",normalized:"ms"},{native:"\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434\u0438",normalized:"ms"},{native:"\u043C\u0456\u043B\u0456\u0441\u0435\u043A\u0443\u043D\u0434",normalized:"ms"},{native:"\u0445\u0432\u0438\u043B\u0438\u043D\u0430",normalized:"m"},{native:"\u0445\u0432\u0438\u043B\u0438\u043D\u0438",normalized:"m"},{native:"\u0445\u0432\u0438\u043B\u0438\u043D",normalized:"m"},{native:"\u0433\u043E\u0434\u0438\u043D\u0430",normalized:"h"},{native:"\u0433\u043E\u0434\u0438\u043D\u0438",normalized:"h"},{native:"\u0433\u043E\u0434\u0438\u043D",normalized:"h"},{native:"\u043F\u0435\u0440\u0448\u0430",normalized:"first"},{native:"\u043F\u0435\u0440\u0448\u0435",normalized:"first"},{native:"\u043E\u0441\u0442\u0430\u043D\u043D\u044F",normalized:"last"},{native:"\u043E\u0441\u0442\u0430\u043D\u043D\u0454",normalized:"last"},{native:"\u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0430",normalized:"next"},{native:"\u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044F",normalized:"previous"},{native:"\u043F\u043E\u0440\u043E\u0436\u043D\u044F",normalized:"empty"},{native:"\u043F\u043E\u0440\u043E\u0436\u043D\u0454",normalized:"empty"},{native:"\u043C\u043E\u044F",normalized:"my"},{native:"\u043C\u043E\u0454",normalized:"my"},{native:"\u043C\u043E\u0457",normalized:"my"}],Wu=class extends K{constructor(){super(),this.language="uk",this.direction="ltr",this.initializeKeywordsFromProfile(Cr,qu),this.setNormalizer(new kr),this.registerExtractors([...$u(),...Mu(),new W,new U,new Lu,new wu,new xu]);}classifyToken(r){let e=r.toLowerCase();return Vu.has(e)?"particle":this.isKeyword(e)?"keyword":/^\.(once|prevent|stop|debounce|throttle|queue)(\(.*\))?$/.test(r)?"event-modifier":r.startsWith("#")||r.startsWith(".")||r.startsWith("[")||r.startsWith("*")||r.startsWith("<")?"selector":r.startsWith('"')||r.startsWith("'")||/^\d/.test(r)?"literal":"identifier"}},Uu=new Wu;J("uk",Uu,Cr);function he(r){let e=r.getAttribute("data-lang");if(e)return xe(e);let t=r.getAttribute("data-hyperscript-lang")??r.closest?.("[data-hyperscript-lang]")?.getAttribute("data-hyperscript-lang");if(t)return xe(t);let i=typeof document<"u"?document.documentElement?.lang:null;return i&&i!=="en"?xe(i):null}function xe(r){return r.split("-")[0].toLowerCase()}var br={add:[["patient",""],["destination","to"]],append:[["patient",""],["destination","to"]],async:[],beep:[["patient",""]],behavior:[["patient",""]],blur:[["patient",""]],break:[],breakpoint:[],call:[["patient",""]],clear:[["patient",""]],clone:[["patient",""],["destination","into"]],close:[["patient",""]],compound:[],continue:[],copy:[["patient",""]],decrement:[["patient",""],["quantity","by"]],default:[["destination",""],["patient","to"]],else:[],empty:[["patient",""]],exit:[],fetch:[["source",""],["responseType","as"],["method","via"],["destination","on"]],focus:[["patient",""]],for:[["patient",""],["source","in"]],get:[["source",""],["destination","on"]],go:[["destination",""]],halt:[["patient",""]],hide:[["patient",""],["style","with"]],if:[["condition",""]],increment:[["patient",""],["quantity","by"]],init:[],install:[["patient",""],["destination","on"]],js:[["patient",""]],log:[["patient",""]],make:[["patient",""]],measure:[["patient",""],["source","of"]],morph:[["destination",""],["patient","to"]],on:[["event",""],["source","from"]],open:[["style","as"],["patient",""]],pick:[["patient",""],["source","from"]],prepend:[["patient",""],["destination","to"]],process:[["patient","partials in"]],push:[["patient","url"]],put:[["patient",""],["destination","into"]],remove:[["patient",""],["source","from"]],render:[["patient",""],["style","with"]],repeat:[["quantity",""],["condition","until"]],replace:[["patient","url"]],reset:[["patient",""]],return:[["patient",""]],scroll:[["destination","to"]],select:[["patient",""]],send:[["event",""],["destination","to"]],set:[["destination",""],["patient","to"]],settle:[["patient",""]],show:[["patient",""],["style","with"]],swap:[["method",""],["destination","of"],["patient","with"]],take:[["patient",""],["source","from"]],tell:[["destination",""]],throw:[["patient",""]],toggle:[["patient",""],["destination","on"]],transition:[["patient",""],["goal","to"],["destination","on"],["duration","over"],["style","with"]],trigger:[["event",""],["destination","on"]],unless:[["condition",""]],wait:[["duration",""]],while:[["condition",""]]};function ve(r){switch(r.kind){case "event-handler":return Ku(r);case "compound":return Gu(r);default:return Hu(r)}}function Ku(r){let e=["on"],t=r.roles.get("event");t&&e.push(se(t));let i=r.roles.get("source");if(i&&e.push("from",se(i)),r.body&&r.body.length>0){let a=r.body.map(ve);e.push(a.join(" then "));}return e.join(" ")}function Gu(r){let e=r.chainType==="async"?"async":r.chainType;return r.statements.map(ve).join(` ${e} `)}function Hu(r){let e=br[r.action];if(e){let i=[r.action];for(let[a,u]of e){let n=r.roles.get(a);n&&(a==="destination"&&n.type==="reference"&&n.value==="me"||(u&&i.push(u),i.push(se(n))));}return i.join(" ")}let t=[r.action];for(let[,i]of r.roles)t.push(se(i));return t.join(" ")}function se(r){switch(r.type){case "literal":return typeof r.value=="string"&&r.dataType==="string"?`"${r.value}"`:String(r.value);case "selector":return r.value;case "reference":return r.value;case "property-path":return Yu(r);case "expression":return r.raw;case "flag":return r.enabled?`+${r.name}`:`~${r.name}`}}function Yu(r){let e=se(r.object),t=r.property;if(r.object.type==="reference")switch(r.object.value){case "me":return `my ${t}`;case "it":return `its ${t}`;case "you":return `your ${t}`}return `${e}'s ${t}`}var wr=.5,Ju={confidenceThreshold:wr,strategy:"semantic",fallbackToOriginal:true};function Xu(r,e){return typeof r=="number"?r:r[e]??r["*"]??wr}function Be(r,e,t={}){let i={...Ju,...t},a=Ar(r,e,i);if(a!==null)return a;let u=Qu(r);if(u){let n=Ar(u.commands,e,i);if(n!==null)return u.prefix+n}return r}function Ar(r,e,t){if(t.strategy==="semantic"||t.strategy==="auto"){let i=Xu(t.confidenceThreshold,e),a=Dr(r,e,i);if(a!==null)return a}if((t.strategy==="auto"||t.strategy==="i18n")&&t.i18nToEnglish){let i=en(r,e,t.i18nToEnglish);if(i!==null)return i}return null}var Zu=/^(on\s+(?:every\s+)?[\w-]+(?:\[.*?\])?(?:\.[\w-]+(?:\([^)]*\))?)*(?:\s+from\s+\S+)?(?:\s+queue\s+\w+)?\s+)/;function Qu(r){let e=r.match(Zu);if(!e)return null;let t=e[1],i=r.slice(t.length);return i?{prefix:t,commands:i}:null}function Dr(r,e,t){try{let i=tn(r,e);if(i.length>1)return an(i,e,t);if(!ur(e))return null;let a=lr(r,e);return a.confidence<t||!a.node?null:ve(a.node)}catch{return null}}function en(r,e,t){try{let i=t(r,e);return i!==r?i:null}catch{return null}}function rn(r){let e=["then"],t=L(r);if(t?.keywords?.then){let i=t.keywords.then;if(i.primary&&i.primary!=="then"&&e.push(i.primary),i.alternatives)for(let a of i.alternatives)e.includes(a)||e.push(a);}return e}function tn(r,e){let i=rn(e).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),a=new RegExp(`\\s+(?:${i.join("|")})\\s+`,"i"),u=r.split(`
4
+ `).map(o=>o.trim()).filter(o=>o.length>0),n=[];for(let o of u){let s=o.split(a);n.push(...s);}return n}function an(r,e,t){let i=[];for(let a of r){let u=Dr(a.trim(),e,t);if(u===null)return null;i.push(u);}return i.join(" then ")}function Fe(r={}){return function(t){let{internals:i}=t,a=i.runtime,u=a.getScript.bind(a);a.getScript=function(n){let o=u(n);if(!o)return null;let s=un(n,r);if(!s||s==="en")return o;let l=Be(o,s,r);return r.debug&&l!==o&&console.log(`[hyperscript-i18n] ${s}: "${o}" \u2192 "${l}"`),l};}}function un(r,e){if(e.languageAttribute){let i=r.getAttribute(e.languageAttribute);if(i)return i.split("-")[0].toLowerCase()}let t=he(r);return t||(e.defaultLanguage??null)}function xr(r,e,t={}){return e==="en"?r:Be(r,e,t)}ar(r=>pr(r));function Br(){typeof _hyperscript<"u"&&_hyperscript.use&&(_hyperscript.use(Fe()),nn());}function nn(){if(typeof document>"u")return;let e=_hyperscript?.internals?.runtime;if(!e?.processNode||!e?.getInternalData)return;let t=e.getScriptSelector?.()??"[_], [script], [data-script]";document.querySelectorAll(t).forEach(i=>{let a=e.getInternalData(i);a.initialized&&(a.initialized=false);}),e.processNode(document.body);}var ys=["ru","pl","uk"];Br();exports.plugin=Fe;exports.preprocess=xr;exports.resolveLanguage=he;exports.supportedLanguages=ys;return exports;})({});