@ngxviewbuilder/plugin-shared 0.13.4 → 0.13.6
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LicenseService as H,NvbIcon as G,UiTranslationService as C,elements as U}from"@ngxviewbuilder/designer";import*as v from"@angular/core";import{ChangeDetectionStrategy as K,Component as Q,Injectable as Y,Pipe as X,computed as J,inject as k,input as M}from"@angular/core";const ee=["visibility","required","locked","value","reset","validation","data","action"];const V={"logic.visibleIf.when":"Visible when","logic.visibleIf.always":"Always visible","logic.visibleIf.never":"Always hidden","logic.requireIf.when":"Required when","logic.requireIf.always":"Always required","logic.requireIf.never":"Never required","logic.disableIf.when":"Disabled when","logic.disableIf.always":"Always disabled","logic.disableIf.never":"Never disabled","logic.readonlyIf.when":"Read-only when","logic.readonlyIf.always":"Always read-only","logic.readonlyIf.never":"Never read-only","logic.resetIf.when":"Cleared when","logic.resetIf.always":"Always cleared","logic.resetIf.never":"Never cleared","logic.expression.when":"Calculated as","logic.op.and":"and","logic.op.or":"or","logic.op.is":"is","logic.op.isNot":"is not","logic.op.not":"not","logic.op.isEmpty":"is empty","logic.op.isNotEmpty":"is not empty","logic.calc.when":"when","logic.calc.otherwise":"otherwise","logic.trigger.click":"On click","logic.trigger.submit":"On submit","logic.trigger.input":"While typing","logic.trigger.change":"On change","logic.trigger.blur":"On leaving the field","logic.trigger.focus":"On entering the field","logic.trigger.beforeLoad":"Before load","logic.trigger.onLoad":"On load","logic.trigger.afterLoad":"After load","logic.trigger.always":"On every event","logic.trigger.whenItRuns":"When it runs","logic.event.beforeLoad":"before the view loads","logic.event.onLoad":"when the view loads","logic.event.afterLoad":"after the view loads","logic.event.valueChanged":"when a value changes","logic.event.pageChanged":"when the page changes","logic.event.dialogClosed":"when a dialog closes","logic.event.validated":"after validation","logic.event.completed":"when the form is completed","logic.event.saveRequested":"when saving is requested","logic.validator.required":"Required","logic.validator.minlength":"At least {value} characters","logic.validator.maxlength":"At most {value} characters","logic.validator.min":"At least {value}","logic.validator.max":"At most {value}","logic.validator.pattern":"Must match {value}","logic.validator.email":"Must be an e-mail address","logic.validator.strictoptions":"Must be one of the listed options","logic.validator.validWhen":"Valid when","logic.validator.onlyWhen":"only when","logic.validator.message":'Message: "{message}"',"logic.data.optionsFrom":"Options come from","logic.data.valueFrom":"Value loaded from","logic.data.sending":"sending","logic.data.requestUses":"Request uses","logic.data.sourceType":"{type} data source","logic.dataSourceType.rest":"REST","logic.dataSourceType.route":"Route","logic.dataSourceType.local":"Local","logic.dataSourceType.websocket":"WebSocket","logic.action.sets":"sets","logic.action.changesProperty":"changes {property} of","logic.action.aProperty":"a property","logic.action.to":"to","logic.action.replacesOptions":"replaces the options of","logic.action.reloads":"reloads","logic.action.calls":"calls","logic.action.aDataSource":"a data source","logic.action.with":"with","logic.action.putsAnswerIn":"and puts the answer in","logic.action.sendsMessageOver":"sends a message over","logic.action.aWebsocket":"a websocket","logic.action.opensDialog":"opens the dialog","logic.action.closesDialog":"closes the dialog","logic.action.togglesDialog":"toggles the dialog","logic.action.goesTo":"goes to {target}","logic.action.anotherPage":"another page","logic.action.showsMessage":'shows the message "{message}"',"logic.action.checksForm":"checks the form","logic.action.submitsForm":"submits the form","logic.action.movesProcess":"moves the process to {state}","logic.action.nextState":"the next state","logic.action.runsAction":"runs an action","logic.action.onlyWhen":"only when","logic.variable.view":"View variable","logic.variable.host":"Host value","logic.variable.calculatedAs":"Calculated as","logic.variable.loadedFrom":"Loaded from","logic.variable.writesTo":"Writes its value to","logic.automation.viewRule":"View rule","logic.automation.trigger":"Trigger {event}","logic.automation.runs":"Runs {event}","logic.automation.applies":"Applies","logic.automation.when":"when","logic.automation.then":"Then","logic.automation.otherwise":"Otherwise","logic.context.column":"Column of {parent}","logic.context.item":"Each item of {parent}","logic.context.in":"In {parent}","logic.missing.field":"Not in this view (field)","logic.missing.dataSource":"Not in this view (data source)","logic.issue.selfReference":"{name} is calculated from its own value, so the calculation never settles.","logic.issue.unknownTarget":'{owner} changes "{name}", which is not in this view.',"logic.issue.unknownDataSource":'{owner} uses the data source "{name}" ({property}), which this view does not define.',"logic.issue.unknownReference":'{owner} ({property}) refers to "{name}", which is not a field, data source or variable in this view.',"logic.issue.cycle":"These values calculate each other in a loop: {names}.","proGate.checking":"Checking the license key…","proGate.missing.eyebrow":"No license key","proGate.expired.eyebrow":"License expired","proGate.invalid.eyebrow":"License key not verified","proGate.missing.text":"This part of the builder comes with an NGX View Builder license. Put your key in the builder settings as licenseKey and it turns on right away.","proGate.expired.textOn":"The license key expired on {date}.","proGate.expired.text":"The license key has expired.","proGate.expired.renew":"Renew the license and everything set up here is still in place.","proGate.invalid.text":"The license key in the builder settings could not be verified. Check that the whole key was copied, or take a fresh one from your license console.","proGate.plans":"See plans","proGate.docs":"Where the key goes"};const I={...V};function te(e){Object.assign(I,e)}function N(e,t){if(!t)return e;return e.replace(/\{(\w+)\}/g,(s,a)=>Object.prototype.hasOwnProperty.call(t,a)?String(t[a]??""):s)}const Z=(e,t,s)=>N(I[e]??s??e,t);function z(e){return(t,s,a)=>N(e.translate(t,I[t]??a??t),s)}var O=class R{t=z(k(C));static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:R,deps:[],target:v.ɵɵFactoryTarget.Injectable});static ɵprov=v.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:R,providedIn:"root"})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:O,decorators:[{type:Y,args:[{providedIn:"root"}]}]});var T=class D{i18n=k(O);transform(t,s){return this.i18n.t(t,s??void 0)}static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:D,deps:[],target:v.ɵɵFactoryTarget.Pipe});static ɵpipe=v.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"22.2.1",ngImport:v,type:D,isStandalone:true,name:"nvbT",pure:false})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:T,decorators:[{type:X,args:[{name:"nvbT",pure:false}]}]});const se=[{key:"visibleIf",kind:"visibility",constants:true},{key:"requireIf",kind:"required",constants:true},{key:"disableIf",kind:"locked",constants:true},{key:"readonlyIf",kind:"locked",constants:true},{key:"resetIf",kind:"reset",constants:true},{key:"expression",kind:"value",constants:false}];const F=new Set(["item","row","panel","value","index","data","parent","this","true","false","null"]);const ae=new Set(["click","submit","input","change","blur","focus","beforeLoad","onLoad","afterLoad","always"]);const ne=new Set(["beforeLoad","onLoad","afterLoad","valueChanged","pageChanged","dialogClosed","validated","completed","saveRequested"]);const re=new Set(["required","minlength","maxlength","min","max","pattern","email","strictoptions"]);const ie=new Map(U.map(e=>[String(e.type),e]));function oe(e,t={}){return new he(u(e),t).build()}function ce(e,t){const s=e.nodes.find(r=>r.id===t);if(!s)return null;const a=r=>{const o=new Map([[t,0]]);const i=[t];while(i.length>0){const n=i.shift();const c=o.get(n);e.edges.forEach(g=>{const l=r?g.from===n?g.to:null:g.to===n?g.from:null;if(l&&!o.has(l)){o.set(l,c+1);i.push(l)}})}o.delete(t);return Array.from(o,([n,c])=>({id:n,depth:c})).sort((n,c)=>n.depth-c.depth)};return{node:s,upstream:a(false),downstream:a(true)}}function W(e){return e.map(t=>"ref"in t?t.label:t.text).join("").replace(/\s+/g," ").trim()}const le=["sumArray","sumInArray","avgArray","avgInArray","minArray","minInArray","maxArray","maxInArray","countArray","countInArray","filterArray","findInArray","existsInArray","mapArray","joinArray","joinInArray","getFirst","getLast","firstInArray","lastInArray","collectValuesFrom"];const ge=new Set(["in","true","false","null","undefined","and","or","not"]);function pe(e,t){const s=[];let a=0;let r="";let o=t+1;for(let i=t;i<e.length;i++){const n=e[i];if(r){if(n==="\\")i++;else if(n===r)r="";continue}if(n==='"'||n==="'")r=n;else if(n==="("||n==="["||n==="{")a++;else if(n===")"||n==="]"||n==="}"){a--;if(a===0){s.push(e.slice(o,i));return s}}else if(n===","&&a===1){s.push(e.slice(o,i));o=i+1}}return s}function b(e){return`el:${e}`}var he=class{structure;options;nodes=new Map;rules=[];issues=[];pages=[];definitions=new Map;pathsByName=new Map;dataSourceNames=new Set;variableNames=new Set;order=0;ruleCounter=0;t;constructor(e,t){this.structure=e;this.options=t;this.t=t.translate??Z}build(){this.collectElements();this.collectDataSources();this.collectVariables();this.definitions.forEach((t,s)=>this.readElementRules(s,t));this.readDataSourceRules();this.readVariableRules();this.readAutomation("rules");this.readAutomation("triggers");const e=this.buildEdges();this.findCycles(e);return{nodes:Array.from(this.nodes.values()).sort((t,s)=>t.order-s.order),rules:this.rules,edges:e,issues:this.issues,pages:this.pages}}collectElements(){const e=u(this.structure["elements"]);(Array.isArray(this.structure["pages"])?this.structure["pages"]:[]).forEach(t=>{const s=u(t);const a=String(s["name"]??"").trim();const r=y(u(e[a])["label"])||a;this.pages.push({name:a,label:r});this.walkLayout(s["rows"],{pageName:a,pageLabel:r,parentPath:"",parentDefinition:null})});Object.entries(e).forEach(([t,s])=>{const a=u(s);if(String(a["type"]??"")==="page"||this.definitions.has(t))return;this.addElement(t,a,{pageName:"",pageLabel:"",parentPath:""})});Array.from(this.definitions.entries()).forEach(([t,s])=>this.addUnplacedChildren(t,s))}walkLayout(e,t){if(Array.isArray(e)){e.forEach(o=>this.walkLayout(o,t));return}if(!e||typeof e!=="object")return;const s=e;const a=String(s["elementRef"]??"").trim();let r=t;if(a){const o=u(u(t.parentDefinition?.["template"])[a]);const i=Object.keys(o).length>0;const n=i?o:u(u(this.structure["elements"])[a]);const c=i&&t.parentPath?`${t.parentPath}.${a}`:a;if(!this.definitions.has(c)&&Object.keys(n).length>0)this.addElement(c,n,t);r={...t,parentPath:c,parentDefinition:n}}Object.entries(s).forEach(([o,i])=>{if(o!=="elementRef"&&i&&typeof i==="object")this.walkLayout(i,r)})}addUnplacedChildren(e,t){const s=u(t["template"]);Object.entries(s).forEach(([a,r])=>{const o=`${e}.${a}`;if(!this.definitions.has(o)){const i=this.nodes.get(b(e));this.addElement(o,u(r),{pageName:i?.pageName??"",pageLabel:i?.pageLabel??"",parentPath:e});this.addUnplacedChildren(o,u(r))}});if(String(t["type"]??"")==="dynamicTable"&&Array.isArray(t["columns"]))t["columns"].forEach(a=>{const r=u(a);const o=String(r["name"]??"").trim();const i=`${e}.${o}`;if(o&&!this.definitions.has(i)){const n=this.nodes.get(b(e));this.addElement(i,r,{pageName:n?.pageName??"",pageLabel:n?.pageLabel??"",parentPath:e})}})}addElement(e,t,s){const a=String(t["type"]??"").trim();const r=ie.get(a);const o=e.split(".").pop();this.definitions.set(e,t);this.pathsByName.set(o,[...this.pathsByName.get(o)??[],e]);this.nodes.set(b(e),{id:b(e),kind:"element",name:e,label:de(t,o),type:a,typeLabel:this.options.typeLabels?.[a]??this.t(`element.${a}`,void 0,r?.label??S(a)),group:String(r?.groupCode??(a==="dynamicTable"?"tables":"")),pageName:s.pageName||void 0,pageLabel:s.pageLabel||void 0,parent:s.parentPath||void 0,context:this.describeContext(s.parentPath)||void 0,order:this.order++,required:t["required"]===true||void 0,hidden:t["hidden"]===true||void 0})}describeContext(e){const t=e?this.nodes.get(b(e)):void 0;if(!t)return"";switch(t.type){case"dynamicTable":return this.t("logic.context.column",{parent:t.label});case"dynamicPanel":return this.t("logic.context.item",{parent:t.label});default:return this.t("logic.context.in",{parent:t.label})}}collectDataSources(){(Array.isArray(this.structure["dataSources"])?this.structure["dataSources"]:[]).forEach(e=>{const t=u(e);const s=String(t["name"]??"").trim();if(!s)return;this.dataSourceNames.add(s);this.nodes.set(`ds:${s}`,{id:`ds:${s}`,kind:"dataSource",name:s,label:y(t["title"])||s,type:String(t["type"]??""),typeLabel:this.t("logic.data.sourceType",{type:this.t(`logic.dataSourceType.${String(t["type"]??"rest")}`,void 0,S(String(t["type"]??"rest")))}),order:1e5+this.order++})})}collectVariables(){const e=u(this.structure["settings"]);(Array.isArray(e["variables"])?e["variables"]:[]).forEach(t=>{const s=u(t);const a=String(s["name"]??"").trim();if(a)this.addVariable(a,y(s["title"])||a,this.t("logic.variable.view"))});(this.options.externalNames??[]).forEach(t=>{if(t&&!this.variableNames.has(t))this.addVariable(t,t,this.t("logic.variable.host"))})}addVariable(e,t,s){this.variableNames.add(e);this.nodes.set(`var:${e}`,{id:`var:${e}`,kind:"variable",name:e,label:t,typeLabel:s,order:2e5+this.order++})}readElementRules(e,t){const s=b(e);se.forEach(({key:a,kind:r,constants:o})=>{const i=String(t[a]??"").trim();if(!i)return;const n=i.toLowerCase();if(o&&(n==="true"||n==="false")){this.addRule({kind:r,owner:s,property:a,expression:i,segments:[{text:this.t(`logic.${a}.${n==="true"?"always":"never"}`)}],sources:[],targets:[]});return}const c=a==="expression"?this.parseCalculation(i,e):this.parseExpression(i,e);this.addRule({kind:r,owner:s,property:a,expression:i,segments:[{text:`${this.t(`logic.${a}.when`)} `},...c.segments],sources:c.refs,targets:[]})});this.readValidators(e,s,t);this.readElementDataSource(e,s,t);this.readActions(e,s,t["events"],"events")}readValidators(e,t,s){(Array.isArray(s["validators"])?s["validators"]:[]).forEach((a,r)=>{const o=u(a);const i=String(o["type"]??"").trim().toLowerCase();const n=String(o["value"]??"").trim();const c=String(o["condition"]??"").trim();const g=String(o["applyIf"]??"").trim();const l=y(o["message"]);const h=[];const p=[];if(i==="custom"&&c){const m=this.parseExpression(c,e);h.push({text:`${this.t("logic.validator.validWhen")} `},...m.segments);p.push(...m.refs)}else h.push({text:re.has(i)?this.t(`logic.validator.${i}`,{value:n}):`${S(i||"rule")}${n?` ${n}`:""}`});if(g){const m=this.parseExpression(g,e);h.push({text:`, ${this.t("logic.validator.onlyWhen")} `},...m.segments);p.push(...m.refs)}if(l)h.push({text:`. ${this.t("logic.validator.message",{message:l})}`});this.addRule({kind:"validation",owner:t,property:`validators[${r}]`,subtype:i||void 0,expression:c||g||void 0,segments:h,sources:p,targets:[]})})}readElementDataSource(e,t,s){const a=u(s["dataSource"]);const r=String(a["name"]??s["dataSourceName"]??"").trim();if(!r)return;const o=this.resolveDataSource(r,t,"dataSource");const i=String(a["useFor"]??"option");const n=o?[o]:[];const c=[{text:`${this.t(i==="value"?"logic.data.valueFrom":"logic.data.optionsFrom")} `},o?{ref:o,label:this.labelOf(o)}:{text:r}];const g=this.readParams(a["params"],e);if(g.segments.length>0){c.push({text:`, ${this.t("logic.data.sending")} `},...g.segments);n.push(...g.refs)}(Array.isArray(a["refreshPaths"])?a["refreshPaths"]:[]).forEach(l=>{const h=this.resolveToken(String(l??""),e);if(h)n.push(h)});this.addRule({kind:"data",owner:t,property:"dataSource",segments:c,sources:n,targets:[]})}readActions(e,t,s,a,r){(Array.isArray(s)?s:[]).forEach((o,i)=>{const n=u(o);const c=String(n["type"]??"").trim();const g=String(n["trigger"]??"").trim();const l=[];const h=[];const p=[];let m="action";const A=r??(g?ae.has(g)?this.t(`logic.trigger.${g}`):S(g):this.t("logic.trigger.whenItRuns"));p.push({text:`${A}: `});const _=f=>{(Array.isArray(f)?f.map(d=>String(d??"")):String(f??"").split(",")).map(d=>d.trim()).filter(Boolean).forEach((d,w)=>{const x=this.resolveTarget(d,t,e);if(w>0)p.push({text:", "});p.push(x?{ref:x,label:this.labelOf(x)}:{text:d});if(x)h.push(x)})};switch(c){case"setValue":case"setElementProperty":{m="value";const f=String(n["setValueTargetPath"]??n["targetElement"]??n["dataPath"]??"").trim();p.push({text:`${c==="setElementProperty"?this.t("logic.action.changesProperty",{property:String(n["propertyKey"]??"")||this.t("logic.action.aProperty")}):this.t("logic.action.sets")} `});_(f);const d=String(n["setValueValue"]??n["valueExpression"]??n["value"]??"").trim();if(d){const w=this.parseExpression(d,e);p.push({text:` ${this.t("logic.action.to")} `},...w.segments);l.push(...w.refs)}break}case"setOptions":m="data";p.push({text:`${this.t("logic.action.replacesOptions")} `});_(n["setOptionsTargetElement"]);break;case"reloadElements":m="data";p.push({text:`${this.t("logic.action.reloads")} `});_(n["reloadElementNames"]);break;case"dataSource":{m="data";const f=String(n["dataSourceName"]??"").trim();const d=f?this.resolveDataSource(f,t,`${a}[${i}]`):null;p.push({text:`${this.t("logic.action.calls")} `},d?{ref:d,label:this.labelOf(d)}:{text:f||this.t("logic.action.aDataSource")});if(d)h.push(d);const w=this.readParams(n["params"],e);if(w.segments.length>0){p.push({text:` ${this.t("logic.action.with")} `},...w.segments);l.push(...w.refs)}const x=String(n["responseTargetElement"]??n["responseTargetPath"]??"").trim();if(x){p.push({text:` ${this.t("logic.action.putsAnswerIn")} `});_(x)}break}case"sendMessage":{const f=String(n["dataSourceName"]??"").trim();const d=f?this.resolveDataSource(f,t,`${a}[${i}]`):null;p.push({text:`${this.t("logic.action.sendsMessageOver")} `},d?{ref:d,label:this.labelOf(d)}:{text:f||this.t("logic.action.aWebsocket")});if(d)h.push(d);break}case"dialog":p.push({text:`${this.t(String(n["dialogOperation"]??"open")==="close"?"logic.action.closesDialog":String(n["dialogOperation"]??"")==="toggle"?"logic.action.togglesDialog":"logic.action.opensDialog")} `});_(n["dialogName"]);break;case"navigate":p.push({text:this.t("logic.action.goesTo",{target:String(n["navigateTo"]??"").trim()||this.t("logic.action.anotherPage")})});break;case"toast":p.push({text:this.t("logic.action.showsMessage",{message:y(n["toastMessage"])||y(n["toastTitle"])||"…"})});break;case"validate":p.push({text:this.t("logic.action.checksForm")});break;case"submit":p.push({text:this.t("logic.action.submitsForm")});break;case"transitionProcess":case"setProcessState":p.push({text:this.t("logic.action.movesProcess",{state:String(n["processState"]??n["processTransitionId"]??"").trim()||this.t("logic.action.nextState")})});break;default:p.push({text:c?S(c).toLowerCase():this.t("logic.action.runsAction")})}String(n["reloadDataSourceNames"]??"").split(",").map(f=>f.trim()).filter(Boolean).forEach(f=>{const d=this.resolveDataSource(f,t,`${a}[${i}]`);if(d){m=m==="action"?"data":m;p.push({text:`, ${this.t("logic.action.reloads")} `},{ref:d,label:this.labelOf(d)});h.push(d)}});const E=String(n["condition"]??"").trim();if(E){const f=this.parseExpression(E,e);p.push({text:`, ${this.t("logic.action.onlyWhen")} `},...f.segments);l.push(...f.refs)}this.addRule({kind:m,owner:t,property:`${a}[${i}]`,subtype:c||void 0,trigger:g||void 0,expression:E||void 0,segments:p,sources:l,targets:h})})}readParams(e,t){const s=Array.isArray(e)?e:[];const a=[];const r=[];s.forEach(o=>{const i=u(o);const n=String(i["name"]??"").trim();const c=String(i["value"]??"").trim();if(!n||!c)return;if(a.length>0)a.push({text:", "});a.push({text:`${n} = `});if(i["isPlainValue"]===true){a.push({text:c});return}const g=/^[A-Za-z_$][\w$]*(\.[\w$]+)*$/.test(c);const l=this.parseExpression(g?`{${c}}`:c,t);a.push(...l.segments);r.push(...l.refs)});return{segments:a,refs:r}}readDataSourceRules(){(Array.isArray(this.structure["dataSources"])?this.structure["dataSources"]:[]).forEach(e=>{const t=u(e);const s=String(t["name"]??"").trim();if(!s)return;const a=new Set;L(t["params"]).forEach(o=>{this.parseExpression(o,null,true).refs.forEach(i=>a.add(i))});if(a.size===0)return;const r=[{text:`${this.t("logic.data.requestUses")} `}];Array.from(a).forEach((o,i)=>{if(i>0)r.push({text:", "});r.push({ref:o,label:this.labelOf(o)})});this.addRule({kind:"data",owner:`ds:${s}`,property:"params",segments:r,sources:Array.from(a),targets:[]})})}readVariableRules(){const e=u(this.structure["settings"]);(Array.isArray(e["variables"])?e["variables"]:[]).forEach(t=>{const s=u(t);const a=String(s["name"]??"").trim();if(!a)return;const r=`var:${a}`;const o=String(s["sourceType"]??"").trim();const i=String(s["expression"]??"").trim();if(o==="expression"&&i){const g=this.parseCalculation(i,null);this.addRule({kind:"value",owner:r,property:"expression",expression:i,segments:[{text:`${this.t("logic.variable.calculatedAs")} `},...g.segments],sources:g.refs,targets:[]})}else if(o==="dataSource"){const g=this.resolveDataSource(String(s["source"]??""),r,"source");if(g)this.addRule({kind:"data",owner:r,property:"source",segments:[{text:`${this.t("logic.variable.loadedFrom")} `},{ref:g,label:this.labelOf(g)}],sources:[g],targets:[]})}const n=String(s["targetPath"]??"").trim();const c=n?this.resolveToken(n,null):null;if(c)this.addRule({kind:"value",owner:r,property:"targetPath",segments:[{text:`${this.t("logic.variable.writesTo")} `},{ref:c,label:this.labelOf(c)}],sources:[],targets:[c]})})}readAutomation(e){const t=u(this.structure["settings"]);(Array.isArray(t[e])?t[e]:[]).forEach((s,a)=>{const r=u(s);const o=String(r["id"]??`${e}${a+1}`).trim();const i=e==="rules"?"rule":"trigger";const n=`${i}:${o}`;const c=y(r["title"])||S(o);this.nodes.set(n,{id:n,kind:i,name:o,label:c,typeLabel:e==="rules"?this.t("logic.automation.viewRule"):this.t("logic.automation.trigger",{event:this.eventWords(String(r["event"]??""))}).trim(),order:3e5+this.order++});const g=[];const l=[];const h=String(r["condition"]??"").trim();if(e==="triggers")l.push({text:this.t("logic.automation.runs",{event:this.eventWords(String(r["event"]??""))})});else l.push({text:this.t("logic.automation.applies")});if(h){const p=this.parseExpression(h,null);l.push({text:` ${this.t("logic.automation.when")} `},...p.segments);g.push(...p.refs)}(Array.isArray(r["watchPaths"])?r["watchPaths"]:[]).forEach(p=>{const m=this.resolveToken(String(p??""),null);if(m)g.push(m)});this.addRule({kind:"action",owner:n,property:"condition",expression:h||void 0,segments:l,sources:g,targets:[]});this.readActions(null,n,r["actions"],"actions",this.t("logic.automation.then"));if(e==="rules")this.readActions(null,n,r["otherwiseActions"],"otherwiseActions",this.t("logic.automation.otherwise"))})}readOperators(e){return e.replace(/\s*&&\s*/g,` ${this.t("logic.op.and")} `).replace(/\s*\|\|\s*/g,` ${this.t("logic.op.or")} `).replace(/\s*!==?\s*/g,` ${this.t("logic.op.isNot")} `).replace(/\s*===?\s*/g,` ${this.t("logic.op.is")} `).replace(/!(?=\s*[({A-Za-z])/g,`${this.t("logic.op.not")} `).replace(/\s+/g," ")}eventWords(e){return ne.has(e)?this.t(`logic.event.${e}`):e}addRule(e){const t=$(e.sources).filter(a=>a!==e.owner||e.property!=="expression");if(e.property==="expression"&&e.sources.includes(e.owner))this.issues.push({severity:"warning",code:"selfReference",message:this.t("logic.issue.selfReference",{name:this.labelOf(e.owner)}),nodeIds:[e.owner]});const s=q(e.segments);this.rules.push({...e,id:`r${++this.ruleCounter}`,segments:s,summary:W(s),sources:t,targets:$(e.targets)})}parseExpression(e,t,s=false){const a=[];const r=[];if(!s){const c=this.t("logic.op.isNotEmpty");const g=this.t("logic.op.isEmpty");e=e.replace(/!\s*isEmpty\(\s*(\{[^{}()]+\})\s*\)/g,(l,h)=>`${h} ${c}`).replace(/\bisEmpty\(\s*(\{[^{}()]+\})\s*\)/g,(l,h)=>`${h} ${g}`)}const o=s?/\{\s*([A-Za-z_$][\w$]*(?:\.[\w$]+|\[\d+\])*)\s*\}/g:/\{\s*([A-Za-z_$][\w$]*(?:\.[\w$]+|\[\d+\])*)\s*\}|\b((?:panel|row)\.[A-Za-z_$][\w$]*)/g;let i=0;let n;while((n=o.exec(e))!==null){if(!s)a.push({text:this.readOperators(e.slice(i,n.index))});const c=(n[1]??n[2]??"").trim();const g=this.resolveToken(c,t);if(g){r.push(g);a.push({ref:g,label:this.labelOf(g)})}else a.push({text:c});i=n.index+n[0].length}if(!s){a.push({text:this.readOperators(e.slice(i))});r.push(...this.aggregateFieldRefs(e,t))}return{segments:q(a),refs:$(r)}}aggregateFieldRefs(e,t){const s=[];const a=new RegExp(`\\b(?:${le.join("|")})\\s*\\(`,"g");let r;while((r=a.exec(e))!==null){const o=pe(e,r.index+r[0].length-1);if(o.length<2)continue;const i=o[0].trim().match(/^\{\s*([^{}]+?)\s*\}$|^((?:panel|row)\.[A-Za-z_$][\w$]*)$/);const n=i?i[1]??i[2]??"":"";const c=n?this.resolveToken(n,t):null;if(!c||!c.startsWith("el:"))continue;const g=c.slice(3);(o[1].replace(/'[^']*'|"[^"]*"|\{[^{}]*\}/g," ").match(/[A-Za-z_$][\w$]*(?:\[\])?(?:\.[A-Za-z_$][\w$]*(?:\[\])?)*(?!\s*\()/g)??[]).forEach(l=>{const h=l.replace(/\[\]/g,"").split(".");if(F.has(h[0])||ge.has(h[0]))return;for(let p=h.length;p>0;p--){const m=`${g}.${h.slice(0,p).join(".")}`;if(this.definitions.has(m)){s.push(b(m));return}}})}return s}parseCalculation(e,t){const s=e.replace(/'[^']*'|"[^"]*"|\([^()]*\)/g,c=>"_".repeat(c.length));const a=s.indexOf("?");const r=s.indexOf(":",a+1);if(!(a>0&&r>a&&s.indexOf("?",a+1)===-1&&s.indexOf(":",r+1)===-1))return this.parseExpression(e,t);const o=this.parseExpression(e.slice(0,a).trim(),t);const i=this.parseExpression(e.slice(a+1,r).trim(),t);const n=this.parseExpression(e.slice(r+1).trim(),t);return{segments:q([...i.segments,{text:` ${this.t("logic.calc.when")} `},...o.segments,{text:`, ${this.t("logic.calc.otherwise")} `},...n.segments]),refs:$([...o.refs,...i.refs,...n.refs])}}resolveToken(e,t){const s=e.replace(/\[\d+\]/g,"").trim();if(!s)return null;const a=s.split(".");const r=a[0];if((r==="panel"||r==="row")&&a.length>1){const i=t&&t.includes(".")?t.slice(0,t.lastIndexOf(".")):"";const n=i?`${i}.${a[1]}`:"";if(n&&this.definitions.has(n))return b(n);return null}if(r.startsWith("__")||r.startsWith("$")||F.has(r))return null;for(let i=a.length;i>0;i--){const n=a.slice(0,i).join(".");if(this.definitions.has(n))return b(n)}const o=this.pathsByName.get(r);if(o&&o.length>0)return b(o[0]);if(this.variableNames.has(r))return`var:${r}`;if(this.dataSourceNames.has(r))return`ds:${r}`;return this.missing(r)}resolveTarget(e,t,s){const a=this.resolveToken(e,s);if(a?.startsWith("missing:"))this.issues.push({severity:"error",code:"unknownTarget",message:this.t("logic.issue.unknownTarget",{owner:this.labelOf(t),name:e}),nodeIds:[t,a]});return a}resolveDataSource(e,t,s){const a=e.trim();if(!a)return null;if(this.dataSourceNames.has(a))return`ds:${a}`;const r=this.missing(a,"dataSource");this.issues.push({severity:"error",code:"unknownDataSource",message:this.t("logic.issue.unknownDataSource",{owner:this.labelOf(t),name:a,property:s}),nodeIds:[t,r]});return r}missing(e,t="field"){const s=`missing:${e}`;if(!this.nodes.has(s))this.nodes.set(s,{id:s,kind:"missing",name:e,label:e,typeLabel:this.t(`logic.missing.${t}`),order:4e5+this.order++});return s}labelOf(e){return this.nodes.get(e)?.label??e.replace(/^[a-z]+:/,"")}buildEdges(){const e=new Map;const t=(s,a,r,o)=>{if(s===a)return;const i=`${s}>${a}>${r}`;if(!e.has(i))e.set(i,{id:i,from:s,to:a,kind:r,ruleId:o})};this.rules.forEach(s=>{s.sources.forEach(a=>t(a,s.owner,s.kind,s.id));s.targets.forEach(a=>t(s.owner,a,s.kind,s.id))});this.rules.filter(s=>s.sources.some(a=>a.startsWith("missing:"))).forEach(s=>{s.sources.filter(a=>a.startsWith("missing:")).forEach(a=>{const r=s.property;this.issues.push({severity:"warning",code:"unknownReference",message:this.t("logic.issue.unknownReference",{owner:this.labelOf(s.owner),property:r,name:this.labelOf(a)}),nodeIds:[s.owner,a],ruleId:s.id})})});return Array.from(e.values())}findCycles(e){const t=new Set(this.rules.filter(l=>l.property==="expression").map(l=>l.id));const s=e.filter(l=>t.has(l.ruleId));const a=new Map;s.forEach(l=>a.set(l.from,[...a.get(l.from)??[],l.to]));let r=0;const o=new Map;const i=new Map;const n=[];const c=new Set;const g=l=>{o.set(l,r);i.set(l,r);r++;n.push(l);c.add(l);(a.get(l)??[]).forEach(h=>{if(!o.has(h)){g(h);i.set(l,Math.min(i.get(l),i.get(h)))}else if(c.has(h))i.set(l,Math.min(i.get(l),o.get(h)))});if(i.get(l)===o.get(l)){const h=[];let p;do{p=n.pop();c.delete(p);h.push(p)}while(p!==l);if(h.length>1){const m=h.map(A=>this.labelOf(A)).reverse().join(" → ");this.issues.push({severity:"error",code:"cycle",message:this.t("logic.issue.cycle",{names:m}),nodeIds:h})}}};Array.from(a.keys()).forEach(l=>{if(!o.has(l))g(l)})}};function u(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function $(e){return Array.from(new Set(e.filter(Boolean)))}function y(e){return String(e??"").replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim()}function de(e,t){for(const s of["label","title","text","checkboxLabel","caption","alt"]){const a=y(e[s]);if(a)return a}return t}function S(e){const t=String(e??"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):""}function q(e){const t=[];e.forEach(s=>{const a=t[t.length-1];if("text"in s&&a&&"text"in a)a.text+=s.text;else if(!("text"in s)||s.text)t.push({...s})});return t}function L(e,t=[]){if(typeof e==="string")t.push(e);else if(Array.isArray(e))e.forEach(s=>L(s,t));else if(e&&typeof e==="object")Object.values(e).forEach(s=>L(s,t));return t}const j={lock:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M220-80q-24.75 0-42.37-17.63Q160-115.25 160-140v-434q0-24.75 17.63-42.38Q195.25-634 220-634h70v-96q0-78.85 55.61-134.42Q401.21-920 480.11-920q78.89 0 134.39 55.58Q670-808.85 670-730v96h70q24.75 0 42.38 17.62Q800-598.75 800-574v434q0 24.75-17.62 42.37Q764.75-80 740-80H220Zm0-60h520v-434H220v434Zm314.5-162.03Q557-324.06 557-355q0-30-22.67-54.5t-54.5-24.5q-31.83 0-54.33 24.5t-22.5 55q0 30.5 22.67 52.5t54.5 22q31.83 0 54.33-22.03ZM350-634h260v-96q0-54.17-37.88-92.08-37.88-37.92-92-37.92T388-822.08q-38 37.91-38 92.08v96ZM220-140v-434 434Z\"/></svg>",account_tree:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M604-120v-125H450v-410h-93v130H80v-315h277v125h247v-125h276v315H604v-130h-94v350h94v-130h276v315H604ZM140-780v195-195Zm524 405v195-195Zm0-405v195-195Zm0 195h156v-195H664v195Zm0 405h156v-195H664v195ZM140-585h157v-195H140v195Z\"/></svg>",filter_list:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M400-240v-60h160v60H400ZM240-450v-60h480v60H240ZM120-660v-60h720v60H120Z\"/></svg>",functions:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M240-160v-63l275-257-275-257v-63h480v100H396l235 220-235 220h324v100H240Z\"/></svg>",cloud_done:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m412-279 230-230-40-40-189 189-100-100-41 41 140 140ZM251-160q-88 0-149.5-61.5T40-371q0-78 50-137t127-71q20-97 94-158.5T482-799q112 0 189 81.5T748-522v24q72-2 122 46.5T920-329q0 69-50 119t-119 50H251Zm0-60h500q45 0 77-32t32-77q0-45-32-77t-77-32h-63v-84q0-91-61-154t-149-63q-88 0-149.5 63T267-522h-19q-62 0-105 43.5T100-371q0 63 44 107t107 44Zm229-260Z\"/></svg>",cloud_off:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M818-56 703-171H248q-88 0-148-59T40-377q0-80 50.5-134T217-577q2-14 6.5-31.5T236-640L70-806l42-42L861-99l-43 43ZM248-231h397L285-591q-11 15-14.5 34t-3.5 37h-19q-62 0-105 39.5t-43 101q0 61.5 43 105T248-231Zm216-181Zm390 210-47-47q25-17 39-38t14-50q0-43-31-73.5T755-441h-67v-81q0-88-61-147.5T478.47-729q-28.47 0-60.97 9T358-691l-42-42q36-29 77.5-42.5T478-789q111 0 190.5 79T748-520v21q72-1 122 45t50 117q0 35-16.5 73.5T854-202ZM583-470Z\"/></svg>",arrow_forward:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M686-450H160v-60h526L438-758l42-42 320 320-320 320-42-42 248-248Z\"/></svg>"};const ue="https://ngxviewbuilder.io/pricing";const ve="https://ngxviewbuilder.io/developers/licensing";var B=class P{license=k(H);ui=k(C);feature=M("",...ngDevMode?[{debugName:"feature"}]:[]);compact=M(false,...ngDevMode?[{debugName:"compact"}]:[]);lockIcon=j.lock;pricingUrl=ue;docsUrl=ve;state=this.license.proAccess;expiresOn=J(()=>{const t=this.license.licenseExpiresAt();return t?t.toLocaleDateString(this.ui.getLanguage()||void 0,{year:"numeric",month:"short",day:"numeric"}):""},...ngDevMode?[{debugName:"expiresOn"}]:[]);static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:P,deps:[],target:v.ɵɵFactoryTarget.Component});static ɵcmp=v.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.2.1",type:P,isStandalone:true,selector:"nvb-pro-feature-gate",inputs:{feature:{classPropertyName:"feature",publicName:"feature",isSignal:true,isRequired:false,transformFunction:null},compact:{classPropertyName:"compact",publicName:"compact",isSignal:true,isRequired:false,transformFunction:null}},ngImport:v,template:"@switch (state()) {\n @case ('ready') {\n <ng-content />\n }\n @case ('checking') {\n <div class=\"nvb-pro-gate nvb-pro-gate--checking\" [class.nvb-pro-gate--compact]=\"compact()\" role=\"status\" data-testid=\"pro-gate-checking\">\n <span class=\"nvb-pro-gate__spinner\" aria-hidden=\"true\"></span>\n <span>{{ 'proGate.checking' | nvbT }}</span>\n </div>\n }\n @default {\n <section\n class=\"nvb-pro-gate\"\n [class.nvb-pro-gate--compact]=\"compact()\"\n [attr.data-state]=\"state()\"\n data-testid=\"pro-gate-locked\"\n >\n <span class=\"nvb-pro-gate__badge\" aria-hidden=\"true\">\n <nvb-icon [svg]=\"lockIcon\" />\n </span>\n <div class=\"nvb-pro-gate__body\">\n <p class=\"nvb-pro-gate__eyebrow\">\n @switch (state()) {\n @case ('missing') {\n {{ 'proGate.missing.eyebrow' | nvbT }}\n }\n @case ('expired') {\n {{ 'proGate.expired.eyebrow' | nvbT }}\n }\n @default {\n {{ 'proGate.invalid.eyebrow' | nvbT }}\n }\n }\n </p>\n <h3 class=\"nvb-pro-gate__title\">{{ feature() }}</h3>\n <p class=\"nvb-pro-gate__text\">\n @switch (state()) {\n @case ('missing') {\n {{\n 'proGate.missing.text' | nvbT\n }}\n }\n @case ('expired') {\n @if (expiresOn()) {\n {{ 'proGate.expired.textOn' | nvbT: { date: expiresOn() } }}\n } @else {\n {{ 'proGate.expired.text' | nvbT }}\n }\n {{ 'proGate.expired.renew' | nvbT }}\n }\n @default {\n {{\n 'proGate.invalid.text' | nvbT\n }}\n }\n }\n </p>\n <div class=\"nvb-pro-gate__actions\">\n <a\n class=\"nvb-button nvb-button--primary nvb-button--sm\"\n [href]=\"pricingUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-plans\"\n >{{ 'proGate.plans' | nvbT }}</a>\n <a\n class=\"nvb-button nvb-button--neutral nvb-button--sm\"\n [href]=\"docsUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-docs\"\n >{{ 'proGate.docs' | nvbT }}</a>\n </div>\n </div>\n </section>\n }\n}\n",styles:[":host{display:contents}.nvb-pro-gate{display:flex;gap:14px;align-items:flex-start;max-width:520px;margin:72px auto 0;padding:20px 22px;border:1px solid var(--nvb-color-neutral-200);border-radius:var(--nvb-radius-lg, 10px);background:var(--nvb-color-neutral-000);color:var(--nvb-color-neutral-800);box-shadow:var(--nvb-card-shadow, none)}.nvb-pro-gate--compact{margin:0;max-width:none;padding:12px;gap:10px;box-shadow:none;background:var(--nvb-color-neutral-050)}.nvb-pro-gate__badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;background:var(--nvb-color-primary-050);color:var(--nvb-color-primary-600);font-size:20px}.nvb-pro-gate--compact .nvb-pro-gate__badge{width:28px;height:28px;font-size:16px}.nvb-pro-gate__body{min-width:0}.nvb-pro-gate__eyebrow{margin:0 0 2px;font-size:11px;font-weight:600;line-height:16px;letter-spacing:.02em;text-transform:uppercase;color:var(--nvb-color-primary-600)}.nvb-pro-gate[data-state=expired] .nvb-pro-gate__eyebrow,.nvb-pro-gate[data-state=invalid] .nvb-pro-gate__eyebrow{color:var(--nvb-color-warning-700)}.nvb-pro-gate__title{margin:0 0 4px;font-size:14px;font-weight:600;line-height:20px;color:var(--nvb-color-neutral-900)}.nvb-pro-gate--compact .nvb-pro-gate__title{font-size:12px;line-height:16px}.nvb-pro-gate__text{margin:0;font-size:13px;line-height:19px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate--compact .nvb-pro-gate__text{font-size:12px;line-height:17px}.nvb-pro-gate__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.nvb-pro-gate--compact .nvb-pro-gate__actions{margin-top:10px}.nvb-pro-gate__actions a{text-decoration:none}.nvb-pro-gate--checking{align-items:center;gap:10px;font-size:13px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate__spinner{width:14px;height:14px;border:2px solid var(--nvb-color-neutral-200);border-top-color:var(--nvb-color-primary-500);border-radius:999px;animation:nvb-pro-gate-spin .8s linear infinite}@keyframes nvb-pro-gate-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.nvb-pro-gate__spinner{animation:none}}\n"],dependencies:[{kind:"component",type:G,selector:"nvb-icon",inputs:["name","svg","ariaLabel"]},{kind:"pipe",type:T,name:"nvbT"}],changeDetection:v.ChangeDetectionStrategy.OnPush})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:B,decorators:[{type:Q,args:[{selector:"nvb-pro-feature-gate",imports:[G,T],changeDetection:K.OnPush,template:"@switch (state()) {\n @case ('ready') {\n <ng-content />\n }\n @case ('checking') {\n <div class=\"nvb-pro-gate nvb-pro-gate--checking\" [class.nvb-pro-gate--compact]=\"compact()\" role=\"status\" data-testid=\"pro-gate-checking\">\n <span class=\"nvb-pro-gate__spinner\" aria-hidden=\"true\"></span>\n <span>{{ 'proGate.checking' | nvbT }}</span>\n </div>\n }\n @default {\n <section\n class=\"nvb-pro-gate\"\n [class.nvb-pro-gate--compact]=\"compact()\"\n [attr.data-state]=\"state()\"\n data-testid=\"pro-gate-locked\"\n >\n <span class=\"nvb-pro-gate__badge\" aria-hidden=\"true\">\n <nvb-icon [svg]=\"lockIcon\" />\n </span>\n <div class=\"nvb-pro-gate__body\">\n <p class=\"nvb-pro-gate__eyebrow\">\n @switch (state()) {\n @case ('missing') {\n {{ 'proGate.missing.eyebrow' | nvbT }}\n }\n @case ('expired') {\n {{ 'proGate.expired.eyebrow' | nvbT }}\n }\n @default {\n {{ 'proGate.invalid.eyebrow' | nvbT }}\n }\n }\n </p>\n <h3 class=\"nvb-pro-gate__title\">{{ feature() }}</h3>\n <p class=\"nvb-pro-gate__text\">\n @switch (state()) {\n @case ('missing') {\n {{\n 'proGate.missing.text' | nvbT\n }}\n }\n @case ('expired') {\n @if (expiresOn()) {\n {{ 'proGate.expired.textOn' | nvbT: { date: expiresOn() } }}\n } @else {\n {{ 'proGate.expired.text' | nvbT }}\n }\n {{ 'proGate.expired.renew' | nvbT }}\n }\n @default {\n {{\n 'proGate.invalid.text' | nvbT\n }}\n }\n }\n </p>\n <div class=\"nvb-pro-gate__actions\">\n <a\n class=\"nvb-button nvb-button--primary nvb-button--sm\"\n [href]=\"pricingUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-plans\"\n >{{ 'proGate.plans' | nvbT }}</a>\n <a\n class=\"nvb-button nvb-button--neutral nvb-button--sm\"\n [href]=\"docsUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-docs\"\n >{{ 'proGate.docs' | nvbT }}</a>\n </div>\n </div>\n </section>\n }\n}\n",styles:[":host{display:contents}.nvb-pro-gate{display:flex;gap:14px;align-items:flex-start;max-width:520px;margin:72px auto 0;padding:20px 22px;border:1px solid var(--nvb-color-neutral-200);border-radius:var(--nvb-radius-lg, 10px);background:var(--nvb-color-neutral-000);color:var(--nvb-color-neutral-800);box-shadow:var(--nvb-card-shadow, none)}.nvb-pro-gate--compact{margin:0;max-width:none;padding:12px;gap:10px;box-shadow:none;background:var(--nvb-color-neutral-050)}.nvb-pro-gate__badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;background:var(--nvb-color-primary-050);color:var(--nvb-color-primary-600);font-size:20px}.nvb-pro-gate--compact .nvb-pro-gate__badge{width:28px;height:28px;font-size:16px}.nvb-pro-gate__body{min-width:0}.nvb-pro-gate__eyebrow{margin:0 0 2px;font-size:11px;font-weight:600;line-height:16px;letter-spacing:.02em;text-transform:uppercase;color:var(--nvb-color-primary-600)}.nvb-pro-gate[data-state=expired] .nvb-pro-gate__eyebrow,.nvb-pro-gate[data-state=invalid] .nvb-pro-gate__eyebrow{color:var(--nvb-color-warning-700)}.nvb-pro-gate__title{margin:0 0 4px;font-size:14px;font-weight:600;line-height:20px;color:var(--nvb-color-neutral-900)}.nvb-pro-gate--compact .nvb-pro-gate__title{font-size:12px;line-height:16px}.nvb-pro-gate__text{margin:0;font-size:13px;line-height:19px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate--compact .nvb-pro-gate__text{font-size:12px;line-height:17px}.nvb-pro-gate__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.nvb-pro-gate--compact .nvb-pro-gate__actions{margin-top:10px}.nvb-pro-gate__actions a{text-decoration:none}.nvb-pro-gate--checking{align-items:center;gap:10px;font-size:13px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate__spinner{width:14px;height:14px;border:2px solid var(--nvb-color-neutral-200);border-top-color:var(--nvb-color-primary-500);border-radius:999px;animation:nvb-pro-gate-spin .8s linear infinite}@keyframes nvb-pro-gate-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.nvb-pro-gate__spinner{animation:none}}\n"]}]}],propDecorators:{feature:[{type:v.Input,args:[{isSignal:true,alias:"feature",required:false}]}],compact:[{type:v.Input,args:[{isSignal:true,alias:"compact",required:false}]}]}});export{V as NGX_VIEW_BUILDER_SHARED_UI_EN,j as NVB_PLUGIN_ICONS,O as NvbPluginI18n,B as NvbProFeatureGate,T as NvbTranslatePipe,ee as VIEW_LOGIC_KINDS,oe as analyzeViewLogic,z as createPluginTranslate,b as elementNodeId,Z as englishTranslate,S as humanize,N as interpolate,y as plainText,te as registerPluginEnglish,W as segmentsToText,ce as traceViewLogic};
|
|
1
|
+
import{LicenseService as H,NvbIcon as G,UiTranslationService as C,elements as U}from"@ngxviewbuilder/designer";import*as v from"@angular/core";import{ChangeDetectionStrategy as K,Component as Q,Injectable as Y,Pipe as X,computed as J,inject as k,input as M}from"@angular/core";const ee=["visibility","required","locked","value","reset","validation","data","action"];const V={"logic.visibleIf.when":"Visible when","logic.visibleIf.always":"Always visible","logic.visibleIf.never":"Always hidden","logic.requireIf.when":"Required when","logic.requireIf.always":"Always required","logic.requireIf.never":"Never required","logic.disableIf.when":"Disabled when","logic.disableIf.always":"Always disabled","logic.disableIf.never":"Never disabled","logic.readonlyIf.when":"Read-only when","logic.readonlyIf.always":"Always read-only","logic.readonlyIf.never":"Never read-only","logic.resetIf.when":"Cleared when","logic.resetIf.always":"Always cleared","logic.resetIf.never":"Never cleared","logic.expression.when":"Calculated as","logic.op.and":"and","logic.op.or":"or","logic.op.is":"is","logic.op.isNot":"is not","logic.op.not":"not","logic.op.isEmpty":"is empty","logic.op.isNotEmpty":"is not empty","logic.calc.when":"when","logic.calc.otherwise":"otherwise","logic.trigger.click":"On click","logic.trigger.submit":"On submit","logic.trigger.input":"While typing","logic.trigger.change":"On change","logic.trigger.blur":"On leaving the field","logic.trigger.focus":"On entering the field","logic.trigger.beforeLoad":"Before load","logic.trigger.onLoad":"On load","logic.trigger.afterLoad":"After load","logic.trigger.always":"On every event","logic.trigger.whenItRuns":"When it runs","logic.event.beforeLoad":"before the view loads","logic.event.onLoad":"when the view loads","logic.event.afterLoad":"after the view loads","logic.event.valueChanged":"when a value changes","logic.event.pageChanged":"when the page changes","logic.event.dialogClosed":"when a dialog closes","logic.event.validated":"after validation","logic.event.completed":"when the form is completed","logic.event.saveRequested":"when saving is requested","logic.validator.required":"Required","logic.validator.minlength":"At least {value} characters","logic.validator.maxlength":"At most {value} characters","logic.validator.min":"At least {value}","logic.validator.max":"At most {value}","logic.validator.pattern":"Must match {value}","logic.validator.email":"Must be an e-mail address","logic.validator.strictoptions":"Must be one of the listed options","logic.validator.validWhen":"Valid when","logic.validator.onlyWhen":"only when","logic.validator.message":'Message: "{message}"',"logic.data.optionsFrom":"Options come from","logic.data.valueFrom":"Value loaded from","logic.data.sending":"sending","logic.data.requestUses":"Request uses","logic.data.sourceType":"{type} data source","logic.dataSourceType.rest":"REST","logic.dataSourceType.route":"Route","logic.dataSourceType.local":"Local","logic.dataSourceType.websocket":"WebSocket","logic.action.sets":"sets","logic.action.changesProperty":"changes {property} of","logic.action.aProperty":"a property","logic.action.to":"to","logic.action.replacesOptions":"replaces the options of","logic.action.reloads":"reloads","logic.action.calls":"calls","logic.action.aDataSource":"a data source","logic.action.with":"with","logic.action.putsAnswerIn":"and puts the answer in","logic.action.sendsMessageOver":"sends a message over","logic.action.aWebsocket":"a websocket","logic.action.opensDialog":"opens the dialog","logic.action.closesDialog":"closes the dialog","logic.action.togglesDialog":"toggles the dialog","logic.action.goesTo":"goes to {target}","logic.action.anotherPage":"another page","logic.action.showsMessage":'shows the message "{message}"',"logic.action.checksForm":"checks the form","logic.action.submitsForm":"submits the form","logic.action.movesProcess":"moves the process to {state}","logic.action.nextState":"the next state","logic.action.runsAction":"runs an action","logic.action.onlyWhen":"only when","logic.variable.view":"View variable","logic.variable.host":"Host value","logic.variable.calculatedAs":"Calculated as","logic.variable.loadedFrom":"Loaded from","logic.variable.writesTo":"Writes its value to","logic.automation.viewRule":"View rule","logic.automation.trigger":"Trigger {event}","logic.automation.runs":"Runs {event}","logic.automation.applies":"Applies","logic.automation.when":"when","logic.automation.then":"Then","logic.automation.otherwise":"Otherwise","logic.context.column":"Column of {parent}","logic.context.item":"Each item of {parent}","logic.context.in":"In {parent}","logic.missing.field":"Not in this view (field)","logic.missing.dataSource":"Not in this view (data source)","logic.issue.selfReference":"{name} is calculated from its own value, so the calculation never settles.","logic.issue.unknownTarget":'{owner} changes "{name}", which is not in this view.',"logic.issue.unknownDataSource":'{owner} uses the data source "{name}" ({property}), which this view does not define.',"logic.issue.unknownReference":'{owner} ({property}) refers to "{name}", which is not a field, data source or variable in this view.',"logic.issue.cycle":"These values calculate each other in a loop: {names}.","proGate.checking":"Checking the license key…","proGate.missing.eyebrow":"No license key","proGate.expired.eyebrow":"License expired","proGate.invalid.eyebrow":"License key not verified","proGate.missing.text":"This part of the builder comes with an NGX View Builder license. Put your key in the builder settings as licenseKey and it turns on right away.","proGate.expired.textOn":"The license key expired on {date}.","proGate.expired.text":"The license key has expired.","proGate.expired.renew":"Renew the license and everything set up here is still in place.","proGate.invalid.text":"The license key in the builder settings could not be verified. Check that the whole key was copied, or take a fresh one from your license console.","proGate.plans":"See plans","proGate.docs":"Where the key goes"};const I={...V};function te(e){Object.assign(I,e)}function N(e,t){if(!t)return e;return e.replace(/\{(\w+)\}/g,(a,s)=>Object.prototype.hasOwnProperty.call(t,s)?String(t[s]??""):a)}const Z=(e,t,a)=>N(I[e]??a??e,t);function z(e){return(t,a,s)=>N(e.translate(t,I[t]??s??t),a)}var O=class R{t=z(k(C));static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:R,deps:[],target:v.ɵɵFactoryTarget.Injectable});static ɵprov=v.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:R,providedIn:"root"})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:O,decorators:[{type:Y,args:[{providedIn:"root"}]}]});var T=class D{i18n=k(O);transform(t,a){return this.i18n.t(t,a??void 0)}static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:D,deps:[],target:v.ɵɵFactoryTarget.Pipe});static ɵpipe=v.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"22.2.1",ngImport:v,type:D,isStandalone:true,name:"nvbT",pure:false})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:T,decorators:[{type:X,args:[{name:"nvbT",pure:false}]}]});const se=[{key:"visibleIf",kind:"visibility",constants:true},{key:"requireIf",kind:"required",constants:true},{key:"disableIf",kind:"locked",constants:true},{key:"readonlyIf",kind:"locked",constants:true},{key:"resetIf",kind:"reset",constants:true},{key:"expression",kind:"value",constants:false}];const F=new Set(["item","row","panel","value","index","data","parent","this","true","false","null"]);const ae=new Set(["click","submit","input","change","blur","focus","beforeLoad","onLoad","afterLoad","always"]);const ne=new Set(["beforeLoad","onLoad","afterLoad","valueChanged","pageChanged","dialogClosed","validated","completed","saveRequested"]);const re=new Set(["required","minlength","maxlength","min","max","pattern","email","strictoptions"]);const ie=new Map(U.map(e=>[String(e.type),e]));function oe(e,t={}){return new he(u(e),t).build()}function ce(e,t){const a=e.nodes.find(r=>r.id===t);if(!a)return null;const s=r=>{const o=new Map([[t,0]]);const i=[t];while(i.length>0){const n=i.shift();const c=o.get(n);e.edges.forEach(g=>{const l=r?g.from===n?g.to:null:g.to===n?g.from:null;if(l&&!o.has(l)){o.set(l,c+1);i.push(l)}})}o.delete(t);return Array.from(o,([n,c])=>({id:n,depth:c})).sort((n,c)=>n.depth-c.depth)};return{node:a,upstream:s(false),downstream:s(true)}}function W(e){return e.map(t=>"ref"in t?t.label:t.text).join("").replace(/\s+/g," ").trim()}const le=["sumArray","sumInArray","avgArray","avgInArray","minArray","minInArray","maxArray","maxInArray","countArray","countInArray","filterArray","findInArray","existsInArray","mapArray","joinArray","joinInArray","getFirst","getLast","firstInArray","lastInArray","collectValuesFrom"];const ge=new Set(["in","true","false","null","undefined","and","or","not"]);function pe(e,t){const a=[];let s=0;let r="";let o=t+1;for(let i=t;i<e.length;i++){const n=e[i];if(r){if(n==="\\")i++;else if(n===r)r="";continue}if(n==='"'||n==="'")r=n;else if(n==="("||n==="["||n==="{")s++;else if(n===")"||n==="]"||n==="}"){s--;if(s===0){a.push(e.slice(o,i));return a}}else if(n===","&&s===1){a.push(e.slice(o,i));o=i+1}}return a}function b(e){return`el:${e}`}var he=class{structure;options;nodes=new Map;rules=[];issues=[];pages=[];definitions=new Map;pathsByName=new Map;dataSourceNames=new Set;variableNames=new Set;order=0;ruleCounter=0;t;constructor(e,t){this.structure=e;this.options=t;this.t=t.translate??Z}build(){this.collectElements();this.collectDataSources();this.collectVariables();this.definitions.forEach((t,a)=>this.readElementRules(a,t));this.readDataSourceRules();this.readVariableRules();this.readAutomation("rules");this.readAutomation("triggers");const e=this.buildEdges();this.findCycles(e);return{nodes:Array.from(this.nodes.values()).sort((t,a)=>t.order-a.order),rules:this.rules,edges:e,issues:this.issues,pages:this.pages}}collectElements(){const e=u(this.structure["elements"]);(Array.isArray(this.structure["pages"])?this.structure["pages"]:[]).forEach(t=>{const a=u(t);const s=String(a["name"]??"").trim();const r=y(u(e[s])["label"])||s;this.pages.push({name:s,label:r});this.walkLayout(a["rows"],{pageName:s,pageLabel:r,parentPath:"",parentDefinition:null})});Object.entries(e).forEach(([t,a])=>{const s=u(a);if(String(s["type"]??"")==="page"||this.definitions.has(t))return;this.addElement(t,s,{pageName:"",pageLabel:"",parentPath:""})});Array.from(this.definitions.entries()).forEach(([t,a])=>this.addUnplacedChildren(t,a))}walkLayout(e,t){if(Array.isArray(e)){e.forEach(o=>this.walkLayout(o,t));return}if(!e||typeof e!=="object")return;const a=e;const s=String(a["elementRef"]??"").trim();let r=t;if(s){const o=u(u(t.parentDefinition?.["template"])[s]);const i=Object.keys(o).length>0;const n=i?o:u(u(this.structure["elements"])[s]);const c=i&&t.parentPath?`${t.parentPath}.${s}`:s;if(!this.definitions.has(c)&&Object.keys(n).length>0)this.addElement(c,n,t);r={...t,parentPath:c,parentDefinition:n}}Object.entries(a).forEach(([o,i])=>{if(o!=="elementRef"&&i&&typeof i==="object")this.walkLayout(i,r)})}addUnplacedChildren(e,t){const a=u(t["template"]);Object.entries(a).forEach(([s,r])=>{const o=`${e}.${s}`;if(!this.definitions.has(o)){const i=this.nodes.get(b(e));this.addElement(o,u(r),{pageName:i?.pageName??"",pageLabel:i?.pageLabel??"",parentPath:e});this.addUnplacedChildren(o,u(r))}});if(String(t["type"]??"")==="dynamicTable"&&Array.isArray(t["columns"]))t["columns"].forEach(s=>{const r=u(s);const o=String(r["name"]??"").trim();const i=`${e}.${o}`;if(o&&!this.definitions.has(i)){const n=this.nodes.get(b(e));this.addElement(i,r,{pageName:n?.pageName??"",pageLabel:n?.pageLabel??"",parentPath:e})}})}addElement(e,t,a){const s=String(t["type"]??"").trim();const r=ie.get(s);const o=e.split(".").pop();this.definitions.set(e,t);this.pathsByName.set(o,[...this.pathsByName.get(o)??[],e]);this.nodes.set(b(e),{id:b(e),kind:"element",name:e,label:de(t,o),type:s,typeLabel:this.options.typeLabels?.[s]??this.t(`element.${s}`,void 0,r?.label??S(s)),group:String(r?.groupCode??(s==="dynamicTable"?"tables":"")),pageName:a.pageName||void 0,pageLabel:a.pageLabel||void 0,parent:a.parentPath||void 0,context:this.describeContext(a.parentPath)||void 0,order:this.order++,required:t["required"]===true||void 0,hidden:t["hidden"]===true||void 0})}describeContext(e){const t=e?this.nodes.get(b(e)):void 0;if(!t)return"";switch(t.type){case"dynamicTable":return this.t("logic.context.column",{parent:t.label});case"dynamicPanel":return this.t("logic.context.item",{parent:t.label});default:return this.t("logic.context.in",{parent:t.label})}}collectDataSources(){(Array.isArray(this.structure["dataSources"])?this.structure["dataSources"]:[]).forEach(e=>{const t=u(e);const a=String(t["name"]??"").trim();if(!a)return;this.dataSourceNames.add(a);this.nodes.set(`ds:${a}`,{id:`ds:${a}`,kind:"dataSource",name:a,label:y(t["title"])||a,type:String(t["type"]??""),typeLabel:this.t("logic.data.sourceType",{type:this.t(`logic.dataSourceType.${String(t["type"]??"rest")}`,void 0,S(String(t["type"]??"rest")))}),order:1e5+this.order++})})}collectVariables(){const e=u(this.structure["settings"]);(Array.isArray(e["variables"])?e["variables"]:[]).forEach(t=>{const a=u(t);const s=String(a["name"]??"").trim();if(s)this.addVariable(s,y(a["title"])||s,this.t("logic.variable.view"))});(this.options.externalNames??[]).forEach(t=>{if(t&&!this.variableNames.has(t))this.addVariable(t,t,this.t("logic.variable.host"))})}addVariable(e,t,a){this.variableNames.add(e);this.nodes.set(`var:${e}`,{id:`var:${e}`,kind:"variable",name:e,label:t,typeLabel:a,order:2e5+this.order++})}readElementRules(e,t){const a=b(e);se.forEach(({key:s,kind:r,constants:o})=>{const i=String(t[s]??"").trim();if(!i)return;const n=i.toLowerCase();if(o&&(n==="true"||n==="false")){this.addRule({kind:r,owner:a,property:s,expression:i,segments:[{text:this.t(`logic.${s}.${n==="true"?"always":"never"}`)}],sources:[],targets:[]});return}const c=s==="expression"?this.parseCalculation(i,e):this.parseExpression(i,e);this.addRule({kind:r,owner:a,property:s,expression:i,segments:[{text:`${this.t(`logic.${s}.when`)} `},...c.segments],sources:c.refs,targets:[]})});this.readValidators(e,a,t);this.readElementDataSource(e,a,t);this.readActions(e,a,t["events"],"events")}readValidators(e,t,a){(Array.isArray(a["validators"])?a["validators"]:[]).forEach((s,r)=>{const o=u(s);const i=String(o["type"]??"").trim().toLowerCase();const n=String(o["value"]??"").trim();const c=String(o["condition"]??"").trim();const g=String(o["applyIf"]??"").trim();const l=y(o["message"]);const h=[];const p=[];if(i==="custom"&&c){const m=this.parseExpression(c,e);h.push({text:`${this.t("logic.validator.validWhen")} `},...m.segments);p.push(...m.refs)}else h.push({text:re.has(i)?this.t(`logic.validator.${i}`,{value:n}):`${S(i||"rule")}${n?` ${n}`:""}`});if(g){const m=this.parseExpression(g,e);h.push({text:`, ${this.t("logic.validator.onlyWhen")} `},...m.segments);p.push(...m.refs)}if(l)h.push({text:`. ${this.t("logic.validator.message",{message:l})}`});this.addRule({kind:"validation",owner:t,property:`validators[${r}]`,subtype:i||void 0,expression:c||g||void 0,segments:h,sources:p,targets:[]})})}readElementDataSource(e,t,a){const s=u(a["dataSource"]);const r=String(s["name"]??a["dataSourceName"]??"").trim();if(!r)return;const o=this.resolveDataSource(r,t,"dataSource");const i=String(s["useFor"]??"option");const n=o?[o]:[];const c=[{text:`${this.t(i==="value"?"logic.data.valueFrom":"logic.data.optionsFrom")} `},o?{ref:o,label:this.labelOf(o)}:{text:r}];const g=this.readParams(s["params"],e);if(g.segments.length>0){c.push({text:`, ${this.t("logic.data.sending")} `},...g.segments);n.push(...g.refs)}(Array.isArray(s["refreshPaths"])?s["refreshPaths"]:[]).forEach(l=>{const h=this.resolveToken(String(l??""),e);if(h)n.push(h)});this.addRule({kind:"data",owner:t,property:"dataSource",segments:c,sources:n,targets:[]})}readActions(e,t,a,s,r){(Array.isArray(a)?a:[]).forEach((o,i)=>{const n=u(o);const c=String(n["type"]??"").trim();const g=String(n["trigger"]??"").trim();const l=[];const h=[];const p=[];let m="action";const A=r??(g?ae.has(g)?this.t(`logic.trigger.${g}`):S(g):this.t("logic.trigger.whenItRuns"));p.push({text:`${A}: `});const _=f=>{(Array.isArray(f)?f.map(d=>String(d??"")):String(f??"").split(",")).map(d=>d.trim()).filter(Boolean).forEach((d,w)=>{const x=this.resolveTarget(d,t,e);if(w>0)p.push({text:", "});p.push(x?{ref:x,label:this.labelOf(x)}:{text:d});if(x)h.push(x)})};switch(c){case"setValue":case"setElementProperty":{m="value";const f=String(n["setValueTargetPath"]??n["targetElement"]??n["dataPath"]??"").trim();p.push({text:`${c==="setElementProperty"?this.t("logic.action.changesProperty",{property:String(n["propertyKey"]??"")||this.t("logic.action.aProperty")}):this.t("logic.action.sets")} `});_(f);const d=String(n["setValueValue"]??n["valueExpression"]??n["value"]??"").trim();if(d){const w=this.parseExpression(d,e);p.push({text:` ${this.t("logic.action.to")} `},...w.segments);l.push(...w.refs)}break}case"setOptions":m="data";p.push({text:`${this.t("logic.action.replacesOptions")} `});_(n["setOptionsTargetElement"]);break;case"reloadElements":m="data";p.push({text:`${this.t("logic.action.reloads")} `});_(n["reloadElementNames"]);break;case"dataSource":{m="data";const f=String(n["dataSourceName"]??"").trim();const d=f?this.resolveDataSource(f,t,`${s}[${i}]`):null;p.push({text:`${this.t("logic.action.calls")} `},d?{ref:d,label:this.labelOf(d)}:{text:f||this.t("logic.action.aDataSource")});if(d)h.push(d);const w=this.readParams(n["params"],e);if(w.segments.length>0){p.push({text:` ${this.t("logic.action.with")} `},...w.segments);l.push(...w.refs)}const x=String(n["responseTargetElement"]??n["responseTargetPath"]??"").trim();if(x){p.push({text:` ${this.t("logic.action.putsAnswerIn")} `});_(x)}break}case"sendMessage":{const f=String(n["dataSourceName"]??"").trim();const d=f?this.resolveDataSource(f,t,`${s}[${i}]`):null;p.push({text:`${this.t("logic.action.sendsMessageOver")} `},d?{ref:d,label:this.labelOf(d)}:{text:f||this.t("logic.action.aWebsocket")});if(d)h.push(d);break}case"dialog":p.push({text:`${this.t(String(n["dialogOperation"]??"open")==="close"?"logic.action.closesDialog":String(n["dialogOperation"]??"")==="toggle"?"logic.action.togglesDialog":"logic.action.opensDialog")} `});_(n["dialogName"]);break;case"navigate":p.push({text:this.t("logic.action.goesTo",{target:String(n["navigateTo"]??"").trim()||this.t("logic.action.anotherPage")})});break;case"toast":p.push({text:this.t("logic.action.showsMessage",{message:y(n["toastMessage"])||y(n["toastTitle"])||"…"})});break;case"validate":p.push({text:this.t("logic.action.checksForm")});break;case"submit":p.push({text:this.t("logic.action.submitsForm")});break;case"transitionProcess":case"setProcessState":p.push({text:this.t("logic.action.movesProcess",{state:String(n["processState"]??n["processTransitionId"]??"").trim()||this.t("logic.action.nextState")})});break;default:p.push({text:c?S(c).toLowerCase():this.t("logic.action.runsAction")})}String(n["reloadDataSourceNames"]??"").split(",").map(f=>f.trim()).filter(Boolean).forEach(f=>{const d=this.resolveDataSource(f,t,`${s}[${i}]`);if(d){m=m==="action"?"data":m;p.push({text:`, ${this.t("logic.action.reloads")} `},{ref:d,label:this.labelOf(d)});h.push(d)}});const E=String(n["condition"]??"").trim();if(E){const f=this.parseExpression(E,e);p.push({text:`, ${this.t("logic.action.onlyWhen")} `},...f.segments);l.push(...f.refs)}this.addRule({kind:m,owner:t,property:`${s}[${i}]`,subtype:c||void 0,trigger:g||void 0,expression:E||void 0,segments:p,sources:l,targets:h})})}readParams(e,t){const a=Array.isArray(e)?e:[];const s=[];const r=[];a.forEach(o=>{const i=u(o);const n=String(i["name"]??"").trim();const c=String(i["value"]??"").trim();if(!n||!c)return;if(s.length>0)s.push({text:", "});s.push({text:`${n} = `});if(i["isPlainValue"]===true){s.push({text:c});return}const g=/^[A-Za-z_$][\w$]*(\.[\w$]+)*$/.test(c);const l=this.parseExpression(g?`{${c}}`:c,t);s.push(...l.segments);r.push(...l.refs)});return{segments:s,refs:r}}readDataSourceRules(){(Array.isArray(this.structure["dataSources"])?this.structure["dataSources"]:[]).forEach(e=>{const t=u(e);const a=String(t["name"]??"").trim();if(!a)return;const s=new Set;L(t["params"]).forEach(o=>{this.parseExpression(o,null,true).refs.forEach(i=>s.add(i))});if(s.size===0)return;const r=[{text:`${this.t("logic.data.requestUses")} `}];Array.from(s).forEach((o,i)=>{if(i>0)r.push({text:", "});r.push({ref:o,label:this.labelOf(o)})});this.addRule({kind:"data",owner:`ds:${a}`,property:"params",segments:r,sources:Array.from(s),targets:[]})})}readVariableRules(){const e=u(this.structure["settings"]);(Array.isArray(e["variables"])?e["variables"]:[]).forEach(t=>{const a=u(t);const s=String(a["name"]??"").trim();if(!s)return;const r=`var:${s}`;const o=String(a["sourceType"]??"").trim();const i=String(a["expression"]??"").trim();if(o==="expression"&&i){const g=this.parseCalculation(i,null);this.addRule({kind:"value",owner:r,property:"expression",expression:i,segments:[{text:`${this.t("logic.variable.calculatedAs")} `},...g.segments],sources:g.refs,targets:[]})}else if(o==="dataSource"){const g=this.resolveDataSource(String(a["source"]??""),r,"source");if(g)this.addRule({kind:"data",owner:r,property:"source",segments:[{text:`${this.t("logic.variable.loadedFrom")} `},{ref:g,label:this.labelOf(g)}],sources:[g],targets:[]})}const n=String(a["targetPath"]??"").trim();const c=n?this.resolveToken(n,null):null;if(c)this.addRule({kind:"value",owner:r,property:"targetPath",segments:[{text:`${this.t("logic.variable.writesTo")} `},{ref:c,label:this.labelOf(c)}],sources:[],targets:[c]})})}readAutomation(e){const t=u(this.structure["settings"]);(Array.isArray(t[e])?t[e]:[]).forEach((a,s)=>{const r=u(a);const o=String(r["id"]??`${e}${s+1}`).trim();const i=e==="rules"?"rule":"trigger";const n=`${i}:${o}`;const c=y(r["title"])||S(o);this.nodes.set(n,{id:n,kind:i,name:o,label:c,typeLabel:e==="rules"?this.t("logic.automation.viewRule"):this.t("logic.automation.trigger",{event:this.eventWords(String(r["event"]??""))}).trim(),order:3e5+this.order++});const g=[];const l=[];const h=String(r["condition"]??"").trim();if(e==="triggers")l.push({text:this.t("logic.automation.runs",{event:this.eventWords(String(r["event"]??""))})});else l.push({text:this.t("logic.automation.applies")});if(h){const p=this.parseExpression(h,null);l.push({text:` ${this.t("logic.automation.when")} `},...p.segments);g.push(...p.refs)}(Array.isArray(r["watchPaths"])?r["watchPaths"]:[]).forEach(p=>{const m=this.resolveToken(String(p??""),null);if(m)g.push(m)});this.addRule({kind:"action",owner:n,property:"condition",expression:h||void 0,segments:l,sources:g,targets:[]});this.readActions(null,n,r["actions"],"actions",this.t("logic.automation.then"));if(e==="rules")this.readActions(null,n,r["otherwiseActions"],"otherwiseActions",this.t("logic.automation.otherwise"))})}readOperators(e){return e.replace(/\s*&&\s*/g,` ${this.t("logic.op.and")} `).replace(/\s*\|\|\s*/g,` ${this.t("logic.op.or")} `).replace(/\s*!==?\s*/g,` ${this.t("logic.op.isNot")} `).replace(/\s*===?\s*/g,` ${this.t("logic.op.is")} `).replace(/!(?=\s*[({A-Za-z])/g,`${this.t("logic.op.not")} `).replace(/\s+/g," ")}eventWords(e){return ne.has(e)?this.t(`logic.event.${e}`):e}addRule(e){const t=$(e.sources).filter(s=>s!==e.owner||e.property!=="expression");if(e.property==="expression"&&e.sources.includes(e.owner))this.issues.push({severity:"warning",code:"selfReference",message:this.t("logic.issue.selfReference",{name:this.labelOf(e.owner)}),nodeIds:[e.owner]});const a=q(e.segments);this.rules.push({...e,id:`r${++this.ruleCounter}`,segments:a,summary:W(a),sources:t,targets:$(e.targets)})}parseExpression(e,t,a=false){const s=[];const r=[];if(!a){const c=this.t("logic.op.isNotEmpty");const g=this.t("logic.op.isEmpty");e=e.replace(/!\s*isEmpty\(\s*(\{[^{}()]+\})\s*\)/g,(l,h)=>`${h} ${c}`).replace(/\bisEmpty\(\s*(\{[^{}()]+\})\s*\)/g,(l,h)=>`${h} ${g}`)}const o=a?/\{\s*([A-Za-z_$][\w$]*(?:\.[\w$]+|\[\d+\])*)\s*\}/g:/\{\s*([A-Za-z_$][\w$]*(?:\.[\w$]+|\[\d+\])*)\s*\}|\b((?:panel|row)\.[A-Za-z_$][\w$]*)/g;let i=0;let n;while((n=o.exec(e))!==null){if(!a)s.push({text:this.readOperators(e.slice(i,n.index))});const c=(n[1]??n[2]??"").trim();const g=this.resolveToken(c,t);if(g){r.push(g);s.push({ref:g,label:this.labelOf(g)})}else s.push({text:c});i=n.index+n[0].length}if(!a){s.push({text:this.readOperators(e.slice(i))});r.push(...this.aggregateFieldRefs(e,t))}return{segments:q(s),refs:$(r)}}aggregateFieldRefs(e,t){const a=[];const s=new RegExp(`\\b(?:${le.join("|")})\\s*\\(`,"g");let r;while((r=s.exec(e))!==null){const o=pe(e,r.index+r[0].length-1);if(o.length<2)continue;const i=o[0].trim().match(/^\{\s*([^{}]+?)\s*\}$|^((?:panel|row)\.[A-Za-z_$][\w$]*)$/);const n=i?i[1]??i[2]??"":"";const c=n?this.resolveToken(n,t):null;if(!c||!c.startsWith("el:"))continue;const g=c.slice(3);(o[1].replace(/'[^']*'|"[^"]*"|\{[^{}]*\}/g," ").match(/[A-Za-z_$][\w$]*(?:\[\])?(?:\.[A-Za-z_$][\w$]*(?:\[\])?)*(?!\s*\()/g)??[]).forEach(l=>{const h=l.replace(/\[\]/g,"").split(".");if(F.has(h[0])||ge.has(h[0]))return;for(let p=h.length;p>0;p--){const m=`${g}.${h.slice(0,p).join(".")}`;if(this.definitions.has(m)){a.push(b(m));return}}})}return a}parseCalculation(e,t){const a=e.replace(/'[^']*'|"[^"]*"|\([^()]*\)/g,c=>"_".repeat(c.length));const s=a.indexOf("?");const r=a.indexOf(":",s+1);if(!(s>0&&r>s&&a.indexOf("?",s+1)===-1&&a.indexOf(":",r+1)===-1))return this.parseExpression(e,t);const o=this.parseExpression(e.slice(0,s).trim(),t);const i=this.parseExpression(e.slice(s+1,r).trim(),t);const n=this.parseExpression(e.slice(r+1).trim(),t);return{segments:q([...i.segments,{text:` ${this.t("logic.calc.when")} `},...o.segments,{text:`, ${this.t("logic.calc.otherwise")} `},...n.segments]),refs:$([...o.refs,...i.refs,...n.refs])}}resolveToken(e,t){const a=e.replace(/\[\d+\]/g,"").trim();if(!a)return null;const s=a.split(".");const r=s[0];if((r==="panel"||r==="row")&&s.length>1){const i=t&&t.includes(".")?t.slice(0,t.lastIndexOf(".")):"";const n=i?`${i}.${s[1]}`:"";if(n&&this.definitions.has(n))return b(n);return null}if(r==="__variables"&&s.length>1&&this.variableNames.has(s[1]))return`var:${s[1]}`;if(r==="__dataSource"&&s.length>1&&this.dataSourceNames.has(s[1]))return`ds:${s[1]}`;if(r.startsWith("__")||r.startsWith("$")||F.has(r))return null;for(let i=s.length;i>0;i--){const n=s.slice(0,i).join(".");if(this.definitions.has(n))return b(n)}const o=this.pathsByName.get(r);if(o&&o.length>0)return b(o[0]);if(this.variableNames.has(r))return`var:${r}`;if(this.dataSourceNames.has(r))return`ds:${r}`;return this.missing(r)}resolveTarget(e,t,a){const s=this.resolveToken(e,a);if(s?.startsWith("missing:"))this.issues.push({severity:"error",code:"unknownTarget",message:this.t("logic.issue.unknownTarget",{owner:this.labelOf(t),name:e}),nodeIds:[t,s]});return s}resolveDataSource(e,t,a){const s=e.trim();if(!s)return null;if(this.dataSourceNames.has(s))return`ds:${s}`;const r=this.missing(s,"dataSource");this.issues.push({severity:"error",code:"unknownDataSource",message:this.t("logic.issue.unknownDataSource",{owner:this.labelOf(t),name:s,property:a}),nodeIds:[t,r]});return r}missing(e,t="field"){const a=`missing:${e}`;if(!this.nodes.has(a))this.nodes.set(a,{id:a,kind:"missing",name:e,label:e,typeLabel:this.t(`logic.missing.${t}`),order:4e5+this.order++});return a}labelOf(e){return this.nodes.get(e)?.label??e.replace(/^[a-z]+:/,"")}buildEdges(){const e=new Map;const t=(a,s,r,o)=>{if(a===s)return;const i=`${a}>${s}>${r}`;if(!e.has(i))e.set(i,{id:i,from:a,to:s,kind:r,ruleId:o})};this.rules.forEach(a=>{a.sources.forEach(s=>t(s,a.owner,a.kind,a.id));a.targets.forEach(s=>t(a.owner,s,a.kind,a.id))});this.rules.filter(a=>a.sources.some(s=>s.startsWith("missing:"))).forEach(a=>{a.sources.filter(s=>s.startsWith("missing:")).forEach(s=>{const r=a.property;this.issues.push({severity:"warning",code:"unknownReference",message:this.t("logic.issue.unknownReference",{owner:this.labelOf(a.owner),property:r,name:this.labelOf(s)}),nodeIds:[a.owner,s],ruleId:a.id})})});return Array.from(e.values())}findCycles(e){const t=new Set(this.rules.filter(l=>l.property==="expression").map(l=>l.id));const a=e.filter(l=>t.has(l.ruleId));const s=new Map;a.forEach(l=>s.set(l.from,[...s.get(l.from)??[],l.to]));let r=0;const o=new Map;const i=new Map;const n=[];const c=new Set;const g=l=>{o.set(l,r);i.set(l,r);r++;n.push(l);c.add(l);(s.get(l)??[]).forEach(h=>{if(!o.has(h)){g(h);i.set(l,Math.min(i.get(l),i.get(h)))}else if(c.has(h))i.set(l,Math.min(i.get(l),o.get(h)))});if(i.get(l)===o.get(l)){const h=[];let p;do{p=n.pop();c.delete(p);h.push(p)}while(p!==l);if(h.length>1){const m=h.map(A=>this.labelOf(A)).reverse().join(" → ");this.issues.push({severity:"error",code:"cycle",message:this.t("logic.issue.cycle",{names:m}),nodeIds:h})}}};Array.from(s.keys()).forEach(l=>{if(!o.has(l))g(l)})}};function u(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{}}function $(e){return Array.from(new Set(e.filter(Boolean)))}function y(e){return String(e??"").replace(/<[^>]*>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\s+/g," ").trim()}function de(e,t){for(const a of["label","title","text","checkboxLabel","caption","alt"]){const s=y(e[a]);if(s)return s}return t}function S(e){const t=String(e??"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):""}function q(e){const t=[];e.forEach(a=>{const s=t[t.length-1];if("text"in a&&s&&"text"in s)s.text+=a.text;else if(!("text"in a)||a.text)t.push({...a})});return t}function L(e,t=[]){if(typeof e==="string")t.push(e);else if(Array.isArray(e))e.forEach(a=>L(a,t));else if(e&&typeof e==="object")Object.values(e).forEach(a=>L(a,t));return t}const j={lock:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M220-80q-24.75 0-42.37-17.63Q160-115.25 160-140v-434q0-24.75 17.63-42.38Q195.25-634 220-634h70v-96q0-78.85 55.61-134.42Q401.21-920 480.11-920q78.89 0 134.39 55.58Q670-808.85 670-730v96h70q24.75 0 42.38 17.62Q800-598.75 800-574v434q0 24.75-17.62 42.37Q764.75-80 740-80H220Zm0-60h520v-434H220v434Zm314.5-162.03Q557-324.06 557-355q0-30-22.67-54.5t-54.5-24.5q-31.83 0-54.33 24.5t-22.5 55q0 30.5 22.67 52.5t54.5 22q31.83 0 54.33-22.03ZM350-634h260v-96q0-54.17-37.88-92.08-37.88-37.92-92-37.92T388-822.08q-38 37.91-38 92.08v96ZM220-140v-434 434Z\"/></svg>",account_tree:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M604-120v-125H450v-410h-93v130H80v-315h277v125h247v-125h276v315H604v-130h-94v350h94v-130h276v315H604ZM140-780v195-195Zm524 405v195-195Zm0-405v195-195Zm0 195h156v-195H664v195Zm0 405h156v-195H664v195ZM140-585h157v-195H140v195Z\"/></svg>",filter_list:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M400-240v-60h160v60H400ZM240-450v-60h480v60H240ZM120-660v-60h720v60H120Z\"/></svg>",functions:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M240-160v-63l275-257-275-257v-63h480v100H396l235 220-235 220h324v100H240Z\"/></svg>",cloud_done:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"m412-279 230-230-40-40-189 189-100-100-41 41 140 140ZM251-160q-88 0-149.5-61.5T40-371q0-78 50-137t127-71q20-97 94-158.5T482-799q112 0 189 81.5T748-522v24q72-2 122 46.5T920-329q0 69-50 119t-119 50H251Zm0-60h500q45 0 77-32t32-77q0-45-32-77t-77-32h-63v-84q0-91-61-154t-149-63q-88 0-149.5 63T267-522h-19q-62 0-105 43.5T100-371q0 63 44 107t107 44Zm229-260Z\"/></svg>",cloud_off:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M818-56 703-171H248q-88 0-148-59T40-377q0-80 50.5-134T217-577q2-14 6.5-31.5T236-640L70-806l42-42L861-99l-43 43ZM248-231h397L285-591q-11 15-14.5 34t-3.5 37h-19q-62 0-105 39.5t-43 101q0 61.5 43 105T248-231Zm216-181Zm390 210-47-47q25-17 39-38t14-50q0-43-31-73.5T755-441h-67v-81q0-88-61-147.5T478.47-729q-28.47 0-60.97 9T358-691l-42-42q36-29 77.5-42.5T478-789q111 0 190.5 79T748-520v21q72-1 122 45t50 117q0 35-16.5 73.5T854-202ZM583-470Z\"/></svg>",arrow_forward:"<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\" viewBox=\"0 -960 960 960\"><path d=\"M686-450H160v-60h526L438-758l42-42 320 320-320 320-42-42 248-248Z\"/></svg>"};const ue="https://ngxviewbuilder.io/pricing";const ve="https://ngxviewbuilder.io/developers/licensing";var B=class P{license=k(H);ui=k(C);feature=M("",...ngDevMode?[{debugName:"feature"}]:[]);compact=M(false,...ngDevMode?[{debugName:"compact"}]:[]);lockIcon=j.lock;pricingUrl=ue;docsUrl=ve;state=this.license.proAccess;expiresOn=J(()=>{const t=this.license.licenseExpiresAt();return t?t.toLocaleDateString(this.ui.getLanguage()||void 0,{year:"numeric",month:"short",day:"numeric"}):""},...ngDevMode?[{debugName:"expiresOn"}]:[]);static ɵfac=v.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:P,deps:[],target:v.ɵɵFactoryTarget.Component});static ɵcmp=v.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.2.1",type:P,isStandalone:true,selector:"nvb-pro-feature-gate",inputs:{feature:{classPropertyName:"feature",publicName:"feature",isSignal:true,isRequired:false,transformFunction:null},compact:{classPropertyName:"compact",publicName:"compact",isSignal:true,isRequired:false,transformFunction:null}},ngImport:v,template:"@switch (state()) {\n @case ('ready') {\n <ng-content />\n }\n @case ('checking') {\n <div class=\"nvb-pro-gate nvb-pro-gate--checking\" [class.nvb-pro-gate--compact]=\"compact()\" role=\"status\" data-testid=\"pro-gate-checking\">\n <span class=\"nvb-pro-gate__spinner\" aria-hidden=\"true\"></span>\n <span>{{ 'proGate.checking' | nvbT }}</span>\n </div>\n }\n @default {\n <section\n class=\"nvb-pro-gate\"\n [class.nvb-pro-gate--compact]=\"compact()\"\n [attr.data-state]=\"state()\"\n data-testid=\"pro-gate-locked\"\n >\n <span class=\"nvb-pro-gate__badge\" aria-hidden=\"true\">\n <nvb-icon [svg]=\"lockIcon\" />\n </span>\n <div class=\"nvb-pro-gate__body\">\n <p class=\"nvb-pro-gate__eyebrow\">\n @switch (state()) {\n @case ('missing') {\n {{ 'proGate.missing.eyebrow' | nvbT }}\n }\n @case ('expired') {\n {{ 'proGate.expired.eyebrow' | nvbT }}\n }\n @default {\n {{ 'proGate.invalid.eyebrow' | nvbT }}\n }\n }\n </p>\n <h3 class=\"nvb-pro-gate__title\">{{ feature() }}</h3>\n <p class=\"nvb-pro-gate__text\">\n @switch (state()) {\n @case ('missing') {\n {{\n 'proGate.missing.text' | nvbT\n }}\n }\n @case ('expired') {\n @if (expiresOn()) {\n {{ 'proGate.expired.textOn' | nvbT: { date: expiresOn() } }}\n } @else {\n {{ 'proGate.expired.text' | nvbT }}\n }\n {{ 'proGate.expired.renew' | nvbT }}\n }\n @default {\n {{\n 'proGate.invalid.text' | nvbT\n }}\n }\n }\n </p>\n <div class=\"nvb-pro-gate__actions\">\n <a\n class=\"nvb-button nvb-button--primary nvb-button--sm\"\n [href]=\"pricingUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-plans\"\n >{{ 'proGate.plans' | nvbT }}</a>\n <a\n class=\"nvb-button nvb-button--neutral nvb-button--sm\"\n [href]=\"docsUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-docs\"\n >{{ 'proGate.docs' | nvbT }}</a>\n </div>\n </div>\n </section>\n }\n}\n",styles:[":host{display:contents}.nvb-pro-gate{display:flex;gap:14px;align-items:flex-start;max-width:520px;margin:72px auto 0;padding:20px 22px;border:1px solid var(--nvb-color-neutral-200);border-radius:var(--nvb-radius-lg, 10px);background:var(--nvb-color-neutral-000);color:var(--nvb-color-neutral-800);box-shadow:var(--nvb-card-shadow, none)}.nvb-pro-gate--compact{margin:0;max-width:none;padding:12px;gap:10px;box-shadow:none;background:var(--nvb-color-neutral-050)}.nvb-pro-gate__badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;background:var(--nvb-color-primary-050);color:var(--nvb-color-primary-600);font-size:20px}.nvb-pro-gate--compact .nvb-pro-gate__badge{width:28px;height:28px;font-size:16px}.nvb-pro-gate__body{min-width:0}.nvb-pro-gate__eyebrow{margin:0 0 2px;font-size:11px;font-weight:600;line-height:16px;letter-spacing:.02em;text-transform:uppercase;color:var(--nvb-color-primary-600)}.nvb-pro-gate[data-state=expired] .nvb-pro-gate__eyebrow,.nvb-pro-gate[data-state=invalid] .nvb-pro-gate__eyebrow{color:var(--nvb-color-warning-700)}.nvb-pro-gate__title{margin:0 0 4px;font-size:14px;font-weight:600;line-height:20px;color:var(--nvb-color-neutral-900)}.nvb-pro-gate--compact .nvb-pro-gate__title{font-size:12px;line-height:16px}.nvb-pro-gate__text{margin:0;font-size:13px;line-height:19px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate--compact .nvb-pro-gate__text{font-size:12px;line-height:17px}.nvb-pro-gate__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.nvb-pro-gate--compact .nvb-pro-gate__actions{margin-top:10px}.nvb-pro-gate__actions a{text-decoration:none}.nvb-pro-gate--checking{align-items:center;gap:10px;font-size:13px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate__spinner{width:14px;height:14px;border:2px solid var(--nvb-color-neutral-200);border-top-color:var(--nvb-color-primary-500);border-radius:999px;animation:nvb-pro-gate-spin .8s linear infinite}@keyframes nvb-pro-gate-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.nvb-pro-gate__spinner{animation:none}}\n"],dependencies:[{kind:"component",type:G,selector:"nvb-icon",inputs:["name","svg","ariaLabel"]},{kind:"pipe",type:T,name:"nvbT"}],changeDetection:v.ChangeDetectionStrategy.OnPush})};v.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.2.1",ngImport:v,type:B,decorators:[{type:Q,args:[{selector:"nvb-pro-feature-gate",imports:[G,T],changeDetection:K.OnPush,template:"@switch (state()) {\n @case ('ready') {\n <ng-content />\n }\n @case ('checking') {\n <div class=\"nvb-pro-gate nvb-pro-gate--checking\" [class.nvb-pro-gate--compact]=\"compact()\" role=\"status\" data-testid=\"pro-gate-checking\">\n <span class=\"nvb-pro-gate__spinner\" aria-hidden=\"true\"></span>\n <span>{{ 'proGate.checking' | nvbT }}</span>\n </div>\n }\n @default {\n <section\n class=\"nvb-pro-gate\"\n [class.nvb-pro-gate--compact]=\"compact()\"\n [attr.data-state]=\"state()\"\n data-testid=\"pro-gate-locked\"\n >\n <span class=\"nvb-pro-gate__badge\" aria-hidden=\"true\">\n <nvb-icon [svg]=\"lockIcon\" />\n </span>\n <div class=\"nvb-pro-gate__body\">\n <p class=\"nvb-pro-gate__eyebrow\">\n @switch (state()) {\n @case ('missing') {\n {{ 'proGate.missing.eyebrow' | nvbT }}\n }\n @case ('expired') {\n {{ 'proGate.expired.eyebrow' | nvbT }}\n }\n @default {\n {{ 'proGate.invalid.eyebrow' | nvbT }}\n }\n }\n </p>\n <h3 class=\"nvb-pro-gate__title\">{{ feature() }}</h3>\n <p class=\"nvb-pro-gate__text\">\n @switch (state()) {\n @case ('missing') {\n {{\n 'proGate.missing.text' | nvbT\n }}\n }\n @case ('expired') {\n @if (expiresOn()) {\n {{ 'proGate.expired.textOn' | nvbT: { date: expiresOn() } }}\n } @else {\n {{ 'proGate.expired.text' | nvbT }}\n }\n {{ 'proGate.expired.renew' | nvbT }}\n }\n @default {\n {{\n 'proGate.invalid.text' | nvbT\n }}\n }\n }\n </p>\n <div class=\"nvb-pro-gate__actions\">\n <a\n class=\"nvb-button nvb-button--primary nvb-button--sm\"\n [href]=\"pricingUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-plans\"\n >{{ 'proGate.plans' | nvbT }}</a>\n <a\n class=\"nvb-button nvb-button--neutral nvb-button--sm\"\n [href]=\"docsUrl\"\n target=\"_blank\"\n rel=\"noopener\"\n data-testid=\"pro-gate-docs\"\n >{{ 'proGate.docs' | nvbT }}</a>\n </div>\n </div>\n </section>\n }\n}\n",styles:[":host{display:contents}.nvb-pro-gate{display:flex;gap:14px;align-items:flex-start;max-width:520px;margin:72px auto 0;padding:20px 22px;border:1px solid var(--nvb-color-neutral-200);border-radius:var(--nvb-radius-lg, 10px);background:var(--nvb-color-neutral-000);color:var(--nvb-color-neutral-800);box-shadow:var(--nvb-card-shadow, none)}.nvb-pro-gate--compact{margin:0;max-width:none;padding:12px;gap:10px;box-shadow:none;background:var(--nvb-color-neutral-050)}.nvb-pro-gate__badge{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:999px;background:var(--nvb-color-primary-050);color:var(--nvb-color-primary-600);font-size:20px}.nvb-pro-gate--compact .nvb-pro-gate__badge{width:28px;height:28px;font-size:16px}.nvb-pro-gate__body{min-width:0}.nvb-pro-gate__eyebrow{margin:0 0 2px;font-size:11px;font-weight:600;line-height:16px;letter-spacing:.02em;text-transform:uppercase;color:var(--nvb-color-primary-600)}.nvb-pro-gate[data-state=expired] .nvb-pro-gate__eyebrow,.nvb-pro-gate[data-state=invalid] .nvb-pro-gate__eyebrow{color:var(--nvb-color-warning-700)}.nvb-pro-gate__title{margin:0 0 4px;font-size:14px;font-weight:600;line-height:20px;color:var(--nvb-color-neutral-900)}.nvb-pro-gate--compact .nvb-pro-gate__title{font-size:12px;line-height:16px}.nvb-pro-gate__text{margin:0;font-size:13px;line-height:19px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate--compact .nvb-pro-gate__text{font-size:12px;line-height:17px}.nvb-pro-gate__actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.nvb-pro-gate--compact .nvb-pro-gate__actions{margin-top:10px}.nvb-pro-gate__actions a{text-decoration:none}.nvb-pro-gate--checking{align-items:center;gap:10px;font-size:13px;color:var(--nvb-color-neutral-600)}.nvb-pro-gate__spinner{width:14px;height:14px;border:2px solid var(--nvb-color-neutral-200);border-top-color:var(--nvb-color-primary-500);border-radius:999px;animation:nvb-pro-gate-spin .8s linear infinite}@keyframes nvb-pro-gate-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.nvb-pro-gate__spinner{animation:none}}\n"]}]}],propDecorators:{feature:[{type:v.Input,args:[{isSignal:true,alias:"feature",required:false}]}],compact:[{type:v.Input,args:[{isSignal:true,alias:"compact",required:false}]}]}});export{V as NGX_VIEW_BUILDER_SHARED_UI_EN,j as NVB_PLUGIN_ICONS,O as NvbPluginI18n,B as NvbProFeatureGate,T as NvbTranslatePipe,ee as VIEW_LOGIC_KINDS,oe as analyzeViewLogic,z as createPluginTranslate,b as elementNodeId,Z as englishTranslate,S as humanize,N as interpolate,y as plainText,te as registerPluginEnglish,W as segmentsToText,ce as traceViewLogic};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngxviewbuilder/plugin-shared",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.6",
|
|
4
4
|
"description": "Shared pieces of the NGX View Builder plugins (view logic analysis, license gate, icons). Installed with the plugins that need it; not meant to be added on its own.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://ngxviewbuilder.io",
|