@wandox/sdk 0.1.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.
- package/README.md +59 -0
- package/dist/arc-BJMRTG9S.cjs +1 -0
- package/dist/arc-Vdco0qfw.js +83 -0
- package/dist/architectureDiagram-3BPJPVTR-BjEqcvey.js +4695 -0
- package/dist/architectureDiagram-3BPJPVTR-BvjJfAkh.cjs +36 -0
- package/dist/blockDiagram-GPEHLZMM-B1xf7RE9.js +2427 -0
- package/dist/blockDiagram-GPEHLZMM-B5VqovGY.cjs +132 -0
- package/dist/c4Diagram-AAUBKEIU-C4kjMRea.js +1578 -0
- package/dist/c4Diagram-AAUBKEIU-Ck5uEnJI.cjs +10 -0
- package/dist/channel-DlRtLuYv.js +5 -0
- package/dist/channel-Dm_yrRYJ.cjs +1 -0
- package/dist/chunk-2J33WTMH-CG2n_n4y.cjs +1 -0
- package/dist/chunk-2J33WTMH-CWvmGb4H.js +20 -0
- package/dist/chunk-4BX2VUAB-Bq3GzsD8.js +9 -0
- package/dist/chunk-4BX2VUAB-CdMctZeT.cjs +1 -0
- package/dist/chunk-55IACEB6-BdJhzL0d.js +8 -0
- package/dist/chunk-55IACEB6-sHyHtvg8.cjs +1 -0
- package/dist/chunk-727SXJPM-D-Vmam30.cjs +206 -0
- package/dist/chunk-727SXJPM-DmruCqjM.js +1529 -0
- package/dist/chunk-AQP2D5EJ-CWhKjcV3.cjs +231 -0
- package/dist/chunk-AQP2D5EJ-Ca0ak6w7.js +1399 -0
- package/dist/chunk-FMBD7UC4-CqV0NWQQ.js +19 -0
- package/dist/chunk-FMBD7UC4-DOxtd0OO.cjs +15 -0
- package/dist/chunk-ND2GUHAM-6EMX5Mu8.js +68 -0
- package/dist/chunk-ND2GUHAM-BXeDBtSC.cjs +1 -0
- package/dist/chunk-QZHKN3VN-B7FSI55w.js +15 -0
- package/dist/chunk-QZHKN3VN-CbbdNKnD.cjs +1 -0
- package/dist/classDiagram-4FO5ZUOK-0Kaf7WfA.js +16 -0
- package/dist/classDiagram-4FO5ZUOK-C4it2xBI.cjs +1 -0
- package/dist/classDiagram-v2-Q7XG4LA2-Byom5adL.js +16 -0
- package/dist/classDiagram-v2-Q7XG4LA2-C4it2xBI.cjs +1 -0
- package/dist/cose-bilkent-S5V4N54A-CuUv9oIm.js +2606 -0
- package/dist/cose-bilkent-S5V4N54A-Dh6nTopA.cjs +1 -0
- package/dist/cytoscape.esm-Cp8cXbK2.js +18729 -0
- package/dist/cytoscape.esm-fcqEUasK.cjs +331 -0
- package/dist/dagre-BM42HDAG-CwxJjZ2n.cjs +4 -0
- package/dist/dagre-BM42HDAG-DMBidMxP.js +448 -0
- package/dist/defaultLocale-BDVPUiG2.js +171 -0
- package/dist/defaultLocale-k2G_58r6.cjs +1 -0
- package/dist/diagram-2AECGRRQ-B2a4nXgJ.js +221 -0
- package/dist/diagram-2AECGRRQ-r7De7taS.cjs +43 -0
- package/dist/diagram-5GNKFQAL-CDiO79WC.cjs +10 -0
- package/dist/diagram-5GNKFQAL-DrHBNZzF.js +123 -0
- package/dist/diagram-KO2AKTUF-BcjWCXZr.js +466 -0
- package/dist/diagram-KO2AKTUF-CDlJCxVO.cjs +3 -0
- package/dist/diagram-LMA3HP47-BXFSAyNV.cjs +24 -0
- package/dist/diagram-LMA3HP47-DJxmyqn0.js +143 -0
- package/dist/diagram-OG6HWLK6-ATK__ca8.js +531 -0
- package/dist/diagram-OG6HWLK6-CgIyEO8_.cjs +24 -0
- package/dist/erDiagram-TEJ5UH35-D4baWNzQ.js +900 -0
- package/dist/erDiagram-TEJ5UH35-Dyuc5EB6.cjs +85 -0
- package/dist/flowDiagram-I6XJVG4X-BMZOncyU.js +1635 -0
- package/dist/flowDiagram-I6XJVG4X-C45fICr4.cjs +162 -0
- package/dist/ganttDiagram-6RSMTGT7-CiYZmmke.js +2526 -0
- package/dist/ganttDiagram-6RSMTGT7-Cxoj6IK8.cjs +292 -0
- package/dist/gitGraphDiagram-PVQCEYII-CQ9bNuwN.js +828 -0
- package/dist/gitGraphDiagram-PVQCEYII-rlaY9dfj.cjs +106 -0
- package/dist/graph-CBizzZ7K.js +1545 -0
- package/dist/graph-V5BNIbHU.cjs +1 -0
- package/dist/index-jBRold1l.js +173159 -0
- package/dist/index-sFrjovbM.cjs +804 -0
- package/dist/index.d.ts +54 -0
- package/dist/infoDiagram-5YYISTIA-CAzYIvUX.js +24 -0
- package/dist/infoDiagram-5YYISTIA-zX5rQglQ.cjs +2 -0
- package/dist/init-CHZsXQcr.cjs +1 -0
- package/dist/init-DjUOC4st.js +16 -0
- package/dist/ishikawaDiagram-YF4QCWOH-09prKBsn.cjs +70 -0
- package/dist/ishikawaDiagram-YF4QCWOH-Co8BnN24.js +622 -0
- package/dist/journeyDiagram-JHISSGLW-DkdWRF_-.cjs +139 -0
- package/dist/journeyDiagram-JHISSGLW-riCLiMCC.js +836 -0
- package/dist/kanban-definition-UN3LZRKU-DWipOCsx.cjs +89 -0
- package/dist/kanban-definition-UN3LZRKU-SRyCSn2H.js +725 -0
- package/dist/katex-Cf_UVKIT.cjs +257 -0
- package/dist/katex-RNjvZ8pg.js +11681 -0
- package/dist/layout-CbksXFOD.js +1728 -0
- package/dist/layout-Dh52gsIJ.cjs +1 -0
- package/dist/linear-C3xSMJV8.cjs +1 -0
- package/dist/linear-CmUCzX9U.js +259 -0
- package/dist/mermaid.core-BzNKr-OJ.cjs +308 -0
- package/dist/mermaid.core-CdBIz6FY.js +15475 -0
- package/dist/mindmap-definition-RKZ34NQL-Cs63oyIX.cjs +96 -0
- package/dist/mindmap-definition-RKZ34NQL-Gcma5iTd.js +830 -0
- package/dist/ordinal-CagbB1m8.cjs +1 -0
- package/dist/ordinal-DfAQgscy.js +61 -0
- package/dist/pieDiagram-4H26LBE5-CBGkD8dp.cjs +30 -0
- package/dist/pieDiagram-4H26LBE5-DSL8cVK1.js +164 -0
- package/dist/quadrantDiagram-W4KKPZXB-D3nCWRjF.cjs +7 -0
- package/dist/quadrantDiagram-W4KKPZXB-uod6bhUy.js +1026 -0
- package/dist/requirementDiagram-4Y6WPE33-Bc_6y7SM.js +884 -0
- package/dist/requirementDiagram-4Y6WPE33-D2mHlh5i.cjs +84 -0
- package/dist/sankeyDiagram-5OEKKPKP-DL_kXejW.cjs +40 -0
- package/dist/sankeyDiagram-5OEKKPKP-DMsjY4G4.js +847 -0
- package/dist/sequenceDiagram-3UESZ5HK-CBGalGOV.cjs +162 -0
- package/dist/sequenceDiagram-3UESZ5HK-CH2Z-Pis.js +2901 -0
- package/dist/stateDiagram-AJRCARHV-gEqlAI6t.js +263 -0
- package/dist/stateDiagram-AJRCARHV-rNMrAI-A.cjs +1 -0
- package/dist/stateDiagram-v2-BHNVJYJU-CDj7L1wi.js +16 -0
- package/dist/stateDiagram-v2-BHNVJYJU-LLlFJ1GM.cjs +1 -0
- package/dist/timeline-definition-PNZ67QCA-Bbuv3uu-.cjs +120 -0
- package/dist/timeline-definition-PNZ67QCA-DrGFbQdC.js +1068 -0
- package/dist/types.d.ts +295 -0
- package/dist/vennDiagram-CIIHVFJN-CGcAwVxU.js +1564 -0
- package/dist/vennDiagram-CIIHVFJN-DsSjXluJ.cjs +34 -0
- package/dist/wandox.cjs +1 -0
- package/dist/wandox.css +1 -0
- package/dist/wandox.js +6 -0
- package/dist/wandox.umd.js +4172 -0
- package/dist/wardley-L42UT6IY-DUnkyH_z.js +22539 -0
- package/dist/wardley-L42UT6IY-tDp0NbFW.cjs +165 -0
- package/dist/wardleyDiagram-YWT4CUSO-CB_Qa4lR.js +684 -0
- package/dist/wardleyDiagram-YWT4CUSO-D0BUmvVW.cjs +78 -0
- package/dist/xychartDiagram-2RQKCTM6-Bcq-ACuw.js +1342 -0
- package/dist/xychartDiagram-2RQKCTM6-BjeAPKLo.cjs +7 -0
- package/package.json +42 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FloatingBallConfig,
|
|
3
|
+
Message,
|
|
4
|
+
PlaybookTriggerOptions,
|
|
5
|
+
WandoxConfig,
|
|
6
|
+
WandoxInstance,
|
|
7
|
+
} from "./types.js";
|
|
8
|
+
|
|
9
|
+
export type * from "./types.js";
|
|
10
|
+
|
|
11
|
+
export declare class FloatingManager {
|
|
12
|
+
constructor(
|
|
13
|
+
token: string,
|
|
14
|
+
domain: string,
|
|
15
|
+
company: string,
|
|
16
|
+
queryClient?: unknown,
|
|
17
|
+
);
|
|
18
|
+
registerFloatingBall(config: FloatingBallConfig): void;
|
|
19
|
+
setFloatingBallConfig(config: Partial<FloatingBallConfig>): void;
|
|
20
|
+
clearMessages(): void;
|
|
21
|
+
getMessages(): Message[];
|
|
22
|
+
enable(): void;
|
|
23
|
+
openDrawer(
|
|
24
|
+
playbookId?: string,
|
|
25
|
+
message?: string,
|
|
26
|
+
agentId?: string,
|
|
27
|
+
useRegisteredFallback?: boolean,
|
|
28
|
+
playbookParams?: Record<string, unknown>,
|
|
29
|
+
enableCustomerService?: boolean,
|
|
30
|
+
): void;
|
|
31
|
+
openDrawerOnly(
|
|
32
|
+
playbookId?: string,
|
|
33
|
+
message?: string,
|
|
34
|
+
agentId?: string,
|
|
35
|
+
useRegisteredFallback?: boolean,
|
|
36
|
+
playbookParams?: Record<string, unknown>,
|
|
37
|
+
enableCustomerService?: boolean,
|
|
38
|
+
): void;
|
|
39
|
+
openDrawerWithPlaybook(options: PlaybookTriggerOptions): void;
|
|
40
|
+
closeDrawer(): void;
|
|
41
|
+
showInspectionResults(robotName?: string): void;
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface WandoxSDK {
|
|
46
|
+
instance: WandoxInstance | null;
|
|
47
|
+
floatingManager: FloatingManager | null;
|
|
48
|
+
init(config: WandoxConfig): WandoxInstance;
|
|
49
|
+
getInstance(): WandoxInstance | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export declare const wandox: WandoxSDK;
|
|
53
|
+
|
|
54
|
+
export default wandox;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { b as e, aB as s, a_ as o, E as i } from "./mermaid.core-CdBIz6FY.js";
|
|
2
|
+
import { p as d } from "./wardley-L42UT6IY-DUnkyH_z.js";
|
|
3
|
+
var g = {
|
|
4
|
+
parse: /* @__PURE__ */ e(async (r) => {
|
|
5
|
+
const a = await d("info", r);
|
|
6
|
+
s.debug(a);
|
|
7
|
+
}, "parse")
|
|
8
|
+
}, p = {
|
|
9
|
+
version: "11.15.0"
|
|
10
|
+
}, v = /* @__PURE__ */ e(() => p.version, "getVersion"), m = {
|
|
11
|
+
getVersion: v
|
|
12
|
+
}, c = /* @__PURE__ */ e((r, a, n) => {
|
|
13
|
+
s.debug(`rendering info diagram
|
|
14
|
+
` + r);
|
|
15
|
+
const t = o(a);
|
|
16
|
+
i(t, 100, 400, !0), t.append("g").append("text").attr("x", 100).attr("y", 40).attr("class", "version").attr("font-size", 32).style("text-anchor", "middle").text(`v${n}`);
|
|
17
|
+
}, "draw"), f = { draw: c }, b = {
|
|
18
|
+
parser: g,
|
|
19
|
+
db: m,
|
|
20
|
+
renderer: f
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
b as diagram
|
|
24
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid.core-BzNKr-OJ.cjs"),o=require("./wardley-L42UT6IY-tDp0NbFW.cjs");var s={parse:e.__name(async r=>{const a=await o.parse("info",r);e.log.debug(a)},"parse")},i={version:"11.15.0"},d=e.__name(()=>i.version,"getVersion"),g={getVersion:d},v=e.__name((r,a,n)=>{e.log.debug(`rendering info diagram
|
|
2
|
+
`+r);const t=e.selectSvgElement(a);e.configureSvgSize(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),c={draw:v},m={parser:s,db:g,renderer:c};exports.diagram=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function a(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}exports.initRange=a;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid.core-BzNKr-OJ.cjs");var tt=function(){var i=e.__name(function(M,t,s,n){for(s=s||{},n=M.length;n--;s[M[n]]=t);return s},"o"),h=[1,4],l=[1,14],r=[1,12],o=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],c=[6,7,11],g=[1,6,13,14],_=[1,23],w=[1,24],x=[1,6,7,11,13,14],N={trace:e.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e.__name(function(t,s,n,u,p,a,v){var k=a.length-1;switch(p){case 6:case 7:return u;case 15:u.addNode(a[k-1].length,a[k].trim());break;case 16:u.addNode(0,a[k].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:l,7:[1,10],9:9,12:11,13:r,14:o},i(y,[2,3]),{1:[2,2]},i(y,[2,4]),i(y,[2,5]),{1:[2,6],6:l,12:15,13:r,14:o},{6:l,9:16,12:11,13:r,14:o},{6:f,7:d,10:17,11:m},i(c,[2,18],{14:[1,21]}),i(c,[2,16]),i(c,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:l,12:15,13:r,14:o},i(g,[2,14],{7:_,11:w}),i(x,[2,8]),i(x,[2,9]),i(x,[2,10]),i(c,[2,15]),i(g,[2,13],{7:_,11:w}),i(x,[2,11]),i(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e.__name(function(t,s){if(s.recoverable)this.trace(t);else{var n=new Error(t);throw n.hash=s,n}},"parseError"),parse:e.__name(function(t){var s=this,n=[0],u=[],p=[null],a=[],v=this.table,k="",I=0,S=0,L=2,E=1,R=a.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var j in this.yy)Object.prototype.hasOwnProperty.call(this.yy,j)&&(C.yy[j]=this.yy[j]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;a.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(P){n.length=n.length-2*P,p.length=p.length-P,a.length=a.length-P}e.__name(F,"popStack");function z(){var P;return P=u.pop()||b.lex()||E,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}e.__name(z,"lex");for(var A,W,B,K,H={},X,V,et,Y;;){if(W=n[n.length-1],this.defaultActions[W]?B=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=z()),B=v[W]&&v[W][A]),typeof B>"u"||!B.length||!B[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
|
|
2
|
+
`+b.showPosition()+`
|
|
3
|
+
Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(B[0]){case 1:n.push(A),p.push(b.yytext),a.push(b.yylloc),n.push(B[1]),A=null,S=b.yyleng,k=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[B[1]][1],H.$=p[p.length-V],H._$={first_line:a[a.length-(V||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(V||1)].first_column,last_column:a[a.length-1].last_column},D&&(H._$.range=[a[a.length-(V||1)].range[0],a[a.length-1].range[1]]),K=this.performAction.apply(H,[k,S,I,C.yy,B[1],p,a].concat(R)),typeof K<"u")return K;V&&(n=n.slice(0,-1*V*2),p=p.slice(0,-1*V),a=a.slice(0,-1*V)),n.push(this.productions_[B[1]][0]),p.push(H.$),a.push(H._$),et=v[n[n.length-2]][n[n.length-1]],n.push(et);break;case 3:return!0}}return!0},"parse")},O=function(){var M={EOF:1,parseError:e.__name(function(s,n){if(this.yy.parser)this.yy.parser.parseError(s,n);else throw new Error(s)},"parseError"),setInput:e.__name(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:e.__name(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:e.__name(function(t){var s=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===u.length?this.yylloc.first_column:0)+u[u.length-n.length].length-n[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:e.__name(function(){return this._more=!0,this},"more"),reject:e.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e.__name(function(t){this.unput(this.match.slice(t))},"less"),pastInput:e.__name(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e.__name(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e.__name(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
5
|
+
`+s+"^"},"showPosition"),test_match:e.__name(function(t,s){var n,u,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),u=t[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in p)this[a]=p[a];return!1}return!1},"test_match"),next:e.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,n,u;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),a=0;a<p.length;a++)if(n=this._input.match(this.rules[p[a]]),n&&(!s||n[0].length>s[0].length)){if(s=n,u=a,this.options.backtrack_lexer){if(t=this.test_match(n,p[a]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[u]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e.__name(function(){var s=this.next();return s||this.lex()},"lex"),begin:e.__name(function(s){this.conditionStack.push(s)},"begin"),popState:e.__name(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:e.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:e.__name(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:e.__name(function(s){this.begin(s)},"pushState"),stateStackSize:e.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e.__name(function(s,n,u,p){switch(u){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return M}();N.lexer=O;function $(){this.yy={}}return e.__name($,"Parser"),$.prototype=N,N.Parser=$,new $}();tt.parser=tt;var ht=tt,Z,ct=(Z=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,e.clear()}getRoot(){return this.root}addNode(h,l){const r=e.common_default.sanitizeText(l,e.getConfig2());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],e.setDiagramTitle(r);return}this.baseLevel??(this.baseLevel=h);let o=h-this.baseLevel+1;for(o<=0&&(o=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=o;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:r,children:[]};y.children.push(f),this.stack.push({level:o,node:f})}getAccTitle(){return e.getAccTitle()}setAccTitle(h){e.setAccTitle(h)}getAccDescription(){return e.getAccDescription()}setAccDescription(h){e.setAccDescription(h)}getDiagramTitle(){return e.getDiagramTitle()}setDiagramTitle(h){e.setDiagramTitle(h)}},e.__name(Z,"IshikawaDB"),Z),ut=14,G=250,dt=30,yt=60,ft=5,lt=82*Math.PI/180,it=Math.cos(lt),nt=Math.sin(lt),st=e.__name((i,h,l)=>{const r=i.node().getBBox(),o=r.width+h*2,y=r.height+h*2;e.configureSvgSize(i,y,o,l),i.attr("viewBox",`${r.x-h} ${r.y-h} ${o} ${y}`)},"applyPaddedViewBox"),pt=e.__name((i,h,l,r)=>{var C,j;const y=r.db.getRoot();if(!y)return;const f=e.getConfig2(),{look:d,handDrawnSeed:m,themeVariables:c}=f,g=e.parseFontSize(f.fontSize)[0]??ut,_=d==="handDrawn",w=y.children??[],x=((C=f.ishikawa)==null?void 0:C.diagramPadding)??20,N=((j=f.ishikawa)==null?void 0:j.useMaxWidth)??!1,O=e.selectSvgElement(h),$=O.append("g").attr("class","ishikawa"),M=_?e.at.svg(O.node()):void 0,t=M?{roughSvg:M,seed:m??0,lineColor:(c==null?void 0:c.lineColor)??"#333",fillColor:(c==null?void 0:c.mainBkg)??"#fff"}:void 0,s=`ishikawa-arrow-${h}`;_||$.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let n=0,u=G;const p=_?void 0:U($,n,u,n,u,"ishikawa-spine");if(_t($,n,u,y.text,g,t),!w.length){_&&U($,n,u,n,u,"ishikawa-spine",t),st(O,x,N);return}n-=20;const a=w.filter((T,D)=>D%2===0),v=w.filter((T,D)=>D%2===1),k=at(a),I=at(v),S=k.total+I.total;let L=G,E=G;if(S>0){const T=G*2,D=G*.3;L=Math.max(D,T*(k.total/S)),E=Math.max(D,T*(I.total/S))}const R=g*2;L=Math.max(L,k.max*R),E=Math.max(E,I.max*R),u=Math.max(L,G),p&&p.attr("y1",u).attr("y2",u),$.select(".ishikawa-head-group").attr("transform",`translate(0,${u})`);const b=Math.ceil(w.length/2);for(let T=0;T<b;T++){const D=$.append("g").attr("class","ishikawa-pair");for(const[F,z,A]of[[w[T*2],-1,L],[w[T*2+1],1,E]])F&&kt(D,F,n,u,z,A,g,t);n=D.selectAll("text").nodes().reduce((F,z)=>Math.min(F,z.getBBox().x),1/0)}if(_)U($,n,u,0,u,"ishikawa-spine",t);else{p.attr("x1",n);const T=`url(#${s})`;$.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",T)}st(O,x,N)},"draw"),at=e.__name(i=>{const h=e.__name(l=>l.children.reduce((r,o)=>r+1+h(o),0),"countDescendants");return i.reduce((l,r)=>{const o=h(r);return l.total+=o,l.max=Math.max(l.max,o),l},{total:0,max:0})},"sideStats"),_t=e.__name((i,h,l,r,o,y)=>{const f=Math.max(6,Math.floor(110/(o*.6))),d=i.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${h},${l})`),m=q(d,ot(r,f),0,0,"ishikawa-head-label","start",o),c=m.node().getBBox(),g=Math.max(60,c.width+6),_=Math.max(40,c.height*2+40),w=`M 0 ${-_/2} L 0 ${_/2} Q ${g*2.4} 0 0 ${-_/2} Z`;if(y){const x=y.roughSvg.path(w,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});d.insert(()=>x,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",w);m.attr("transform",`translate(${(g-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),gt=e.__name((i,h)=>{const l=[],r=[],o=e.__name((y,f,d)=>{const m=h===-1?[...y].reverse():y;for(const c of m){const g=l.length,_=c.children??[];l.push({depth:d,text:ot(c.text,15),parentIndex:f,childCount:_.length}),d%2===0?(r.push(g),_.length&&o(_,g,d+1)):(_.length&&o(_,g,d+1),r.push(g))}},"walk");return o(i,-1,2),{entries:l,yOrder:r}},"flattenTree"),mt=e.__name((i,h,l,r,o,y,f)=>{const d=i.append("g").attr("class","ishikawa-label-group"),c=q(d,h,l,r+11*o,"ishikawa-label cause","middle",y).node().getBBox();if(f){const g=f.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});d.insert(()=>g,":first-child").attr("class","ishikawa-label-box")}else d.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",c.x-20).attr("y",c.y-2).attr("width",c.width+40).attr("height",c.height+4)},"drawCauseLabel"),J=e.__name((i,h,l,r,o,y)=>{const f=Math.sqrt(r*r+o*o);if(f===0)return;const d=r/f,m=o/f,c=6,g=-m*c,_=d*c,w=h,x=l,N=`M ${w} ${x} L ${w-d*c*2+g} ${x-m*c*2+_} L ${w-d*c*2-g} ${x-m*c*2-_} Z`,O=y.roughSvg.path(N,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});i.append(()=>O)},"drawArrowMarker"),kt=e.__name((i,h,l,r,o,y,f,d)=>{const m=h.children??[],c=y*(m.length?1:.2),g=-it*c,_=nt*c*o,w=l+g,x=r+_;if(U(i,l,r,w,x,"ishikawa-branch",d),d&&J(i,l,r,l-w,r-x,d),mt(i,h.text,w,x,o,f,d),!m.length)return;const{entries:N,yOrder:O}=gt(m,o),$=N.length,M=new Array($);for(const[p,a]of O.entries())M[a]=r+_*((p+1)/($+1));const t=new Map;t.set(-1,{x0:l,y0:r,x1:w,y1:x,childCount:m.length,childrenDrawn:0});const s=-it,n=nt*o,u=o<0?"ishikawa-label up":"ishikawa-label down";for(const[p,a]of N.entries()){const v=M[p],k=t.get(a.parentIndex),I=i.append("g").attr("class","ishikawa-sub-group");let S=0,L=0,E=0;if(a.depth%2===0){const R=k.y1-k.y0;S=rt(k.x0,k.x1,R?(v-k.y0)/R:.5),L=v,E=S-(a.childCount>0?yt+a.childCount*ft:dt),U(I,S,v,E,v,"ishikawa-sub-branch",d),d&&J(I,S,v,1,0,d),q(I,a.text,E,v,"ishikawa-label align","end",f)}else{const R=k.childrenDrawn++;S=rt(k.x0,k.x1,(k.childCount-R)/(k.childCount+1)),L=k.y0,E=S+s*((v-L)/n),U(I,S,L,E,v,"ishikawa-sub-branch",d),d&&J(I,S,L,S-E,L-v,d),q(I,a.text,E,v,u,"end",f)}a.childCount>0&&t.set(p,{x0:S,y0:L,x1:E,y1:v,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),wt=e.__name(i=>i.split(/<br\s*\/?>|\n/),"splitLines"),ot=e.__name((i,h)=>{if(i.length<=h)return i;const l=[];for(const r of i.split(/\s+/)){const o=l.length-1;o>=0&&l[o].length+1+r.length<=h?l[o]+=" "+r:l.push(r)}return l.join(`
|
|
7
|
+
`)},"wrapText"),q=e.__name((i,h,l,r,o,y,f)=>{const d=wt(h),m=f*1.05,c=i.append("text").attr("class",o).attr("text-anchor",y).attr("x",l).attr("y",r-(d.length-1)*m/2);for(const[g,_]of d.entries())c.append("tspan").attr("x",l).attr("dy",g===0?0:m).text(_);return c},"drawMultilineText"),rt=e.__name((i,h,l)=>i+(h-i)*l,"lerp"),U=e.__name((i,h,l,r,o,y,f)=>{if(f){const d=f.roughSvg.line(h,l,r,o,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});i.append(()=>d).attr("class",y);return}return i.append("line").attr("class",y).attr("x1",h).attr("y1",l).attr("x2",r).attr("y2",o)},"drawLine"),bt={draw:pt},xt=e.__name(i=>`
|
|
8
|
+
.ishikawa .ishikawa-spine,
|
|
9
|
+
.ishikawa .ishikawa-branch,
|
|
10
|
+
.ishikawa .ishikawa-sub-branch {
|
|
11
|
+
stroke: ${i.lineColor};
|
|
12
|
+
stroke-width: 2;
|
|
13
|
+
fill: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ishikawa .ishikawa-sub-branch {
|
|
17
|
+
stroke-width: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ishikawa .ishikawa-arrow {
|
|
21
|
+
fill: ${i.lineColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ishikawa .ishikawa-head {
|
|
25
|
+
fill: ${i.mainBkg};
|
|
26
|
+
stroke: ${i.lineColor};
|
|
27
|
+
stroke-width: 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ishikawa .ishikawa-label-box {
|
|
31
|
+
fill: ${i.mainBkg};
|
|
32
|
+
stroke: ${i.lineColor};
|
|
33
|
+
stroke-width: 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ishikawa text {
|
|
37
|
+
font-family: ${i.fontFamily};
|
|
38
|
+
font-size: ${i.fontSize};
|
|
39
|
+
fill: ${i.textColor};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ishikawa .ishikawa-head-label {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ishikawa .ishikawa-label {
|
|
50
|
+
text-anchor: end;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ishikawa .ishikawa-label.cause {
|
|
54
|
+
text-anchor: middle;
|
|
55
|
+
dominant-baseline: middle;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ishikawa .ishikawa-label.align {
|
|
59
|
+
text-anchor: end;
|
|
60
|
+
dominant-baseline: middle;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ishikawa .ishikawa-label.up {
|
|
64
|
+
dominant-baseline: baseline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ishikawa .ishikawa-label.down {
|
|
68
|
+
dominant-baseline: hanging;
|
|
69
|
+
}
|
|
70
|
+
`,"getStyles"),vt=xt,St={parser:ht,get db(){return new ct},renderer:bt,styles:vt};exports.diagram=St;
|