"use strict";function_interopDefault(e){returne&&"object"==typeofe&&"default"ine?e.default:e}functionindex(e){consti=e.types;return{inherits:syntaxJsx,visitor:{Program(e){e.traverse({JSXAttribute(e){constn=parseVModel(i,e);if(n){const{modifiers:modifiers,valuePath:valuePath}=n,t=e.parentPath;transformModel(i,t,valuePath,modifiers),e.remove()}}})}}}}varcamelCase=_interopDefault(require("camelcase")),syntaxJsx=_interopDefault(require("@babel/plugin-syntax-jsx")),htmlTags=_interopDefault(require("html-tags")),svgTags=_interopDefault(require("svg-tags"));constRANGE_TOKEN="__r",cachedCamelCase=(()=>{conste=Object.create(null);returni=>{e[i]||(e[i]=camelCase(i));returne[i]}})(),equalCamel=(e,i)=>e===i||e===cachedCamelCase(i),startsWithCamel=(e,i)=>e.startsWith(i)||e.startsWith(cachedCamelCase(i)),parseVModel=(e,i)=>{if(e.isJSXNamespacedName(i.get("name"))||!startsWithCamel(i.get("name.name").node,"v-model"))returnnull;if(!e.isJSXExpressionContainer(i.get("value")))thrownewError("You have to use JSX Expression inside your v-model");constn=i.get("name.name").node.split("_");n.shift();return{modifiers:newSet(n),valuePath:i.get("value.expression")}},transformModel=(e,i,n,t)=>{if(isComponent(e,i))returngenComponentModel(e,i,n,t);constr=getTagName(e,i);consts=getType(e,i);if("select"===r)genSelect(e,i,n,t);elseif("input"===r&&"checkbox"===s)genCheckboxModel(e,i,n,t);elseif("input"===r&&"radio"===s)genRadioModel(e,i,n,t);else{if("input"!==r&&"textarea"!==r)thrownewError(`vModel: ${r}[type=${s}] is not supported`);genDefaultModel(e,i,n,t,s)}addModel(e,i,n,t)},isComponent=(e,i)=>{constn=i.get("name");if(e.isJSXMemberExpression(n))return!0;constt=n.get("name").node;return!htmlTags.includes(t)&&!svgTags.includes(t)},getTagName=(e,i)=>i.get("name.name").node,getType=(e,i)=>{constn=i.get("attributes").find(i=>e.isJSXAttribute(i)&&e.isJSXIdentifier(i.get("name"))&&"type"===i.get("name.name").node&&e.isStringLiteral(i.get("value")));returnn?n.get("value.value").node:""},addHandler=(e,i,n,t)=>{addProp(e,i,`on-${n}`,e.arrowFunctionExpression([e.identifier("$event")],e.blockStatement(t)),!0)},addProp=(e,i,n,t,r=!1)=>{i.node.attributes[r?"unshift":"push"](e.jSXAttribute(e.jSXIdentifier(n),e.jSXExpressionContainer(t)))},genAssignmentCode=(e,i,n)=>{lett;returne.isMemberExpression(i)&&!e.isThisExpression(t=i.get("object").node)?e.callExpression(e.memberExpression(e.thisExpression(),e.identifier("$set")),[t,i.node.computed?i.get("property").node:e.stringLiteral(i.get("property.name").node),n]):e.assignmentExpression("=",i.node,n)},getBindingAttr=(e,i,n)=>{constt=i.get("attributes").find(i=>e.isJSXAttribute(i)&&e.isJSXIdentifier(i.get("name"))&&equalCamel(i.get("name.name").node,n));if(t){consti=e.isJSXExpressionContainer(t.get("value"))?t.get("value.expression").node:t.get("value").node;returnt.remove(),i}returnnull},genComponentModel=(e,i,n,t)=>{constr=e.identifier("$$v");lets=r;t.has("trim")&&(s=e.conditionalExpression(e.binaryExpression("===",e.unaryExpression("typeof",r),e.stringLiteral("string")),e.callExpression(e.memberExpression(r,e.identifier("trim")),[]),r));t.has("number")&&(s=e.callExpression(e.memberExpression(e.thisExpression(),e.identifier("_n")),[s]));consto=genAssignmentCode(e,n,s);i.node.attributes.push(e.jSXAttribute(e.jSXIdentifier("model"),e.jSXExpressionContainer(e.objectExpression([e.objectProperty(e.identifier("value"),n.node),e.objectProperty(e.identifier("callback"),e.arrowFunctionExpression([e.identifier("$$v")],e.blockStatement([e.expressionStatement(o)])))]))))},genSelect=(e,i,n,t)=>{constr=t.has("number");consts=e.conditionalExpression(e.binaryExpression("in",e.stringLiteral("_value"),e.identifier("o")),e.memberExpression(e.identifier("o"),e.identifier("_value")),e.memberExpression(e.identifier("o"),e.identifier("value")));consto=e.callExpression(e.memberExpression(e.callExpression(e.memberExpression(e.memberExpression(e.memberExpression(e.identifier("Array"),e.identifier("prototype")),e.identifier("filter")),e.identifier("call")),[e.memberExpression(e.memberExpression(e.identifi