@softistx/pulsarix-widget 0.8.3 → 0.8.4
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/dist/chunks/{abnfDiagram-XWFEHMT6.9eyf87ze.js → abnfDiagram-XWFEHMT6.b9yk4x5x.js} +1 -1
- package/dist/chunks/architecture-WOLXFQ4H.aft3rkrr.js +1 -0
- package/dist/chunks/{architectureDiagram-CSQXQB3N.cy6247c8.js → architectureDiagram-CSQXQB3N.qz18rz0g.js} +1 -1
- package/dist/chunks/{blockDiagram-BEDRHYPZ.an5w7tk4.js → blockDiagram-BEDRHYPZ.bb08b9nt.js} +1 -1
- package/dist/chunks/{c4Diagram-M2UUVUY5.512525r3.js → c4Diagram-M2UUVUY5.px0epccd.js} +2 -2
- package/dist/chunks/{chat-markdown-COFhHMpe.fm39gs4e.js → chat-markdown-CrbWbK1O.k4nmgyey.js} +5 -5
- package/dist/chunks/{classDiagram-v2-KXABOMEV.5gw6azyv.js → classDiagram-v2-KXABOMEV.f02387t9.js} +2 -2
- package/dist/chunks/{cose-bilkent-JH36ORCC.9t42zmky.js → cose-bilkent-JH36ORCC.azq9k24r.js} +1 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.dk039jny.js +1 -0
- package/dist/chunks/{cynefinDiagram-NJNITYFG.dta2tfnh.js → cynefinDiagram-NJNITYFG.zt7gprt1.js} +1 -1
- package/dist/chunks/{dagre-KIHZ2IZ3.k7b2vmwy.js → dagre-KIHZ2IZ3.702bqbr9.js} +1 -1
- package/dist/chunks/{diagram-7YQZDPLS.cd2t0saz.js → diagram-7YQZDPLS.m7vf21j6.js} +1 -1
- package/dist/chunks/{diagram-QBROCOUO.1x4d8w7m.js → diagram-QBROCOUO.33e5hv7x.js} +3 -3
- package/dist/chunks/{diagram-RJJCUUZO.jk65d82z.js → diagram-RJJCUUZO.94k74bz7.js} +2 -2
- package/dist/chunks/{diagram-WERXNKYE.85c3en4j.js → diagram-WERXNKYE.7fe849z6.js} +1 -1
- package/dist/chunks/{diagram-YHHI257C.y494n4nm.js → diagram-YHHI257C.qjjjfq7w.js} +2 -2
- package/dist/chunks/{diagram-YR4HJLHV.z2n88j9s.js → diagram-YR4HJLHV.310x2we2.js} +1 -1
- package/dist/chunks/{ebnfDiagram-N527522P.cgfkzbkp.js → ebnfDiagram-N527522P.a4crteq1.js} +1 -1
- package/dist/chunks/{editor-shortcuts-dialog-Ch8GFC-h.n66q7eep.js → editor-shortcuts-dialog-B0ppoiza.x3p4h07t.js} +1 -1
- package/dist/chunks/editor.arg3zy29.js +4 -0
- package/dist/chunks/{elk-O5DQBFGD.188pnf8b.js → elk-O5DQBFGD.dx61etan.js} +1 -1
- package/dist/chunks/{emoji-picker-Cv6ZOgpd.cmp5h45n.js → emoji-picker-CbvQZ2ZL.nst616hd.js} +2 -2
- package/dist/chunks/{erDiagram-K3K3BIDK.abxf5cgs.js → erDiagram-K3K3BIDK.qzqv67zm.js} +5 -5
- package/dist/chunks/eventmodeling-K75KTNOO.gmm1bcak.js +1 -0
- package/dist/chunks/{flow-diagram-B6X1M34-.awp18a9v.js → flow-diagram-AiM6FiIm.73jr19pb.js} +1 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.fzwqg115.js +1 -0
- package/dist/chunks/{ganttDiagram-3PRQTZWP.p72ak8vx.js → ganttDiagram-3PRQTZWP.xngzb32h.js} +2 -2
- package/dist/chunks/gitGraph-VSP46ZUC.0m8jykgw.js +1 -0
- package/dist/chunks/{gitGraphDiagram-VXDFKS5L.vtq378bg.js → gitGraphDiagram-VXDFKS5L.1sm36z2q.js} +1 -1
- package/dist/chunks/{grid-E2QIVN74.8xqrr45y.js → grid-E2QIVN74.76pgtn2n.js} +1 -1
- package/dist/chunks/illustration-BOW28wq5.bkz28k1x.js +1 -0
- package/dist/chunks/{index.pb5tn7q8.js → index.0e4s8r4m.js} +1 -1
- package/dist/chunks/{index.8hmrz817.js → index.0k4tbjhp.js} +1 -1
- package/dist/chunks/{index.je7pqrtm.js → index.1d7qpsyx.js} +2 -2
- package/dist/chunks/{index.x22rwqsz.js → index.32jxrb9b.js} +2 -2
- package/dist/chunks/{index.yd3167gn.js → index.7gxz6d1f.js} +2 -2
- package/dist/chunks/{index.r8wc9n4q.js → index.7k5v3p25.js} +1 -1
- package/dist/chunks/{index.nphh2dtn.js → index.8f3x951p.js} +1 -1
- package/dist/chunks/{index.ybmxf4mt.js → index.9bf5qrah.js} +1 -1
- package/dist/chunks/{index.mjfjqm0b.js → index.a1bxkgd3.js} +10 -10
- package/dist/chunks/{index.cf9nd6xy.js → index.a6rz456z.js} +2 -2
- package/dist/chunks/{index.b0pypc3w.js → index.dnnzjw18.js} +1 -1
- package/dist/chunks/index.e35b4yh5.js +44 -0
- package/dist/chunks/{index.jgvp2nkv.js → index.fbeztcp3.js} +1 -1
- package/dist/chunks/{index.2jsv3483.js → index.hvdnkr5m.js} +2 -2
- package/dist/chunks/{index.3k4gyba0.js → index.nsckd1vt.js} +2 -2
- package/dist/chunks/{index.btq862bx.js → index.r0p3fm9f.js} +1 -1
- package/dist/chunks/{index.psaka010.js → index.rfyzb2yv.js} +1 -1
- package/dist/chunks/{index.vm7ezzet.js → index.t34t6kpe.js} +2 -2
- package/dist/chunks/{index.6tc2v7mk.js → index.wrjdgn4c.js} +2 -2
- package/dist/chunks/{index.qy1pndre.js → index.zm5x44tn.js} +1 -1
- package/dist/chunks/info-OHQRW6UA.e0a85drn.js +1 -0
- package/dist/chunks/{infoDiagram-EZ3ZOAHP.q0047zjz.js → infoDiagram-EZ3ZOAHP.pfd0fjwn.js} +1 -1
- package/dist/chunks/{ishikawaDiagram-S3EKX5GW.41wwb1jp.js → ishikawaDiagram-S3EKX5GW.h5kjez1x.js} +2 -2
- package/dist/chunks/{journeyDiagram-POQNLL5X.2c9swtn6.js → journeyDiagram-POQNLL5X.55cqc9p0.js} +2 -2
- package/dist/chunks/{kanban-definition-BH5XI6FM.xznh9d30.js → kanban-definition-BH5XI6FM.pkdvda4y.js} +1 -1
- package/dist/chunks/{markup-color-chrome-ykGNUl8y.955bjndb.js → markup-color-chrome-ykGNUl8y.0ds56d6x.js} +1 -1
- package/dist/chunks/{markup-custom-color-Dou38qUi.w8c65wn1.js → markup-custom-color-Dgm2hHI7.7darvajx.js} +1 -1
- package/dist/chunks/{mention-list-D4eNNVs0.2k5cdtgy.js → mention-list-CkAUzPBG.mtjgmmzb.js} +1 -1
- package/dist/chunks/{mermaid.core.d680cq0m.js → mermaid.core.j7s05j63.js} +4 -4
- package/dist/chunks/{mindmap-definition-WVAN44T4.k41b9d4r.js → mindmap-definition-WVAN44T4.x3jbxvft.js} +1 -1
- package/dist/chunks/packet-JDAUHWVQ.52409p3r.js +1 -0
- package/dist/chunks/{panel.yh0jnkha.js → panel.9tp7gr60.js} +1 -1
- package/dist/chunks/{pegDiagram-D4NLKWP3.x25624w6.js → pegDiagram-D4NLKWP3.xq15gqy9.js} +1 -1
- package/dist/chunks/pie-XZMESJXO.q5kre8cx.js +1 -0
- package/dist/chunks/{pieDiagram-36ENHN4W.j4fq9134.js → pieDiagram-36ENHN4W.8h0wam54.js} +2 -2
- package/dist/chunks/{plated-illustration-0ro04oJt.0ebg0x7r.js → plated-illustration-COZYWJ81.xy7ba5mq.js} +1 -1
- package/dist/chunks/{quadrantDiagram-ZQUDMS73.1vgwgk90.js → quadrantDiagram-ZQUDMS73.k28g8jpn.js} +2 -2
- package/dist/chunks/radar-ABXABTNO.yk872k2n.js +1 -0
- package/dist/chunks/railroad-I3PHUGI6.9wfa6vs3.js +1 -0
- package/dist/chunks/railroad-abnf-LNEFI6M7.70zznk3b.js +1 -0
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.4pvdng0p.js +1 -0
- package/dist/chunks/railroad-peg-JR7BVNR7.ev15ebp6.js +1 -0
- package/dist/chunks/{railroadDiagram-JIZHGYPL.pbv1rqfp.js → railroadDiagram-JIZHGYPL.e7p2vqgg.js} +1 -1
- package/dist/chunks/{render-VIF2ZAQL.2kz294jj.js → render-VIF2ZAQL.w5ytncsg.js} +1 -1
- package/dist/chunks/{requirementDiagram-AXW2TVFA.qnxmvqx8.js → requirementDiagram-AXW2TVFA.arekdz02.js} +2 -2
- package/dist/chunks/{sankeyDiagram-FBCJTAIF.whv6dy60.js → sankeyDiagram-FBCJTAIF.1d04xcmb.js} +2 -2
- package/dist/chunks/{sequenceDiagram-3LA2ROMG.w52darq5.js → sequenceDiagram-3LA2ROMG.j4xywwp1.js} +2 -2
- package/dist/chunks/{sizeCapture-2Q2CQKSF.zgscrz2v.js → sizeCapture-2Q2CQKSF.862bnf6p.js} +1 -1
- package/dist/chunks/{stateDiagram-v2-ATKHQDJO.zk8w1ht1.js → stateDiagram-v2-ATKHQDJO.xvvtr0y2.js} +2 -2
- package/dist/chunks/{swimlanes-YQL5WMAO.cn1pz0jc.js → swimlanes-YQL5WMAO.dtnjb4xt.js} +1 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.0q8kd5qn.js +8 -0
- package/dist/chunks/{timeline-definition-7Z437IG3.atpqnb0j.js → timeline-definition-7Z437IG3.zfhqzc4r.js} +1 -1
- package/dist/chunks/treeView-D4JQ5SDB.3fzswdjp.js +1 -0
- package/dist/chunks/treemap-SAJKECNS.cgh74bhn.js +1 -0
- package/dist/chunks/{usecaseDiagram-RDK6N6HP.ase4sfgd.js → usecaseDiagram-RDK6N6HP.ewxnyz4c.js} +2 -2
- package/dist/chunks/{vennDiagram-SHRQU5PJ.as8z3hh5.js → vennDiagram-SHRQU5PJ.wkzf1f00.js} +2 -2
- package/dist/chunks/wardley-7MLQ67FV.6q5tgt0s.js +1 -0
- package/dist/chunks/{wardleyDiagram-F3OXNVQS.8pf1xb65.js → wardleyDiagram-F3OXNVQS.srjfm4nb.js} +1 -1
- package/dist/chunks/{xychartDiagram-GDYJKCDI.z35xw169.js → xychartDiagram-GDYJKCDI.xfa2vexk.js} +2 -2
- package/dist/index.js +15 -15
- package/package.json +2 -2
- package/dist/chunks/architecture-WOLXFQ4H.230b0n6c.js +0 -1
- package/dist/chunks/cynefin-EF2NZ3EQ.e9ycn4jb.js +0 -1
- package/dist/chunks/editor.yc8q5dd1.js +0 -4
- package/dist/chunks/eventmodeling-K75KTNOO.q3y4xbmj.js +0 -1
- package/dist/chunks/flowDiagram-Z6JWZHQI.af312t1k.js +0 -1
- package/dist/chunks/gitGraph-VSP46ZUC.e4envgw8.js +0 -1
- package/dist/chunks/illustration-BpmMAKpO.brt46gkr.js +0 -1
- package/dist/chunks/index.5vcex75v.js +0 -44
- package/dist/chunks/info-OHQRW6UA.yhwzx56w.js +0 -1
- package/dist/chunks/packet-JDAUHWVQ.gp9cmm94.js +0 -1
- package/dist/chunks/pie-XZMESJXO.fx385qqa.js +0 -1
- package/dist/chunks/radar-ABXABTNO.d58r1mqp.js +0 -1
- package/dist/chunks/railroad-I3PHUGI6.cwq84f31.js +0 -1
- package/dist/chunks/railroad-abnf-LNEFI6M7.7z7d547m.js +0 -1
- package/dist/chunks/railroad-ebnf-DWYD2UWJ.geje0ygg.js +0 -1
- package/dist/chunks/railroad-peg-JR7BVNR7.f8xnzs1y.js +0 -1
- package/dist/chunks/swimlanesDiagram-UCCPES4V.cy9ywqbn.js +0 -8
- package/dist/chunks/treeView-D4JQ5SDB.fj76b06b.js +0 -1
- package/dist/chunks/treemap-SAJKECNS.yk7967y9.js +0 -1
- package/dist/chunks/wardley-7MLQ67FV.r3k2k1ra.js +0 -1
package/dist/chunks/{ishikawaDiagram-S3EKX5GW.41wwb1jp.js → ishikawaDiagram-S3EKX5GW.h5kjez1x.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{e,y,j,A,L,I,
|
|
1
|
+
import{e,y,j,A,L,R,I,M,D,O,u,Y,Qe,g}from"./index.a1bxkgd3.js";var dt=function(){var t=e(function(z,i,n,s){for(n=n||{},s=z.length;s--;n[z[s]]=i);return n},"o"),f=[1,4],r=[1,14],l=[1,12],o=[1,13],p=[6,7,8],m=[1,20],d=[1,18],x=[1,19],c=[6,7,11],_=[1,6,13,14],b=[1,23],S=[1,24],E=[1,6,7,11,13,14],U={trace:e(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(function(i,n,s,h,k,a,T){var v=a.length-1;switch(k){case 6:case 7:return h;case 15:h.addNode(a[v-1].length,a[v].trim());break;case 16:h.addNode(0,a[v].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:r,7:[1,10],9:9,12:11,13:l,14:o},t(p,[2,3]),{1:[2,2]},t(p,[2,4]),t(p,[2,5]),{1:[2,6],6:r,12:15,13:l,14:o},{6:r,9:16,12:11,13:l,14:o},{6:m,7:d,10:17,11:x},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:m,7:d,10:22,11:x},{1:[2,7],6:r,12:15,13:l,14:o},t(_,[2,14],{7:b,11:S}),t(E,[2,8]),t(E,[2,9]),t(E,[2,10]),t(c,[2,15]),t(_,[2,13],{7:b,11:S}),t(E,[2,11]),t(E,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(i,n){if(n.recoverable)this.trace(i);else{var s=Error(i);throw s.hash=n,s}},"parseError"),parse:e(function(i){var n=this,s=[0],h=[],k=[null],a=[],T=this.table,v="",V=0,P=0,C=0,W=2,X=1,rt=a.slice.call(arguments,1),w=Object.create(this.lexer),B={yy:{}};for(var q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,q))B.yy[q]=this.yy[q];if(w.setInput(i,B.yy),B.yy.lexer=w,B.yy.parser=this,typeof w.yylloc>"u")w.yylloc={};var Q=w.yylloc;a.push(Q);var lt=w.options&&w.options.ranges;if(typeof B.yy.parseError==="function")this.parseError=B.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function xt(G){s.length=s.length-2*G,k.length=k.length-G,a.length=a.length-G}e(xt,"popStack");function yt(){var G=h.pop()||w.lex()||X;if(typeof G!=="number"){if(G instanceof Array)h=G,G=h.pop();G=n.symbols_[G]||G}return G}e(yt,"lex");var F,ot,J,H,Vt,ht,tt={},st,K,ft,nt;while(!0){if(J=s[s.length-1],this.defaultActions[J])H=this.defaultActions[J];else{if(F===null||typeof F>"u")F=yt();H=T[J]&&T[J][F]}if(typeof H>"u"||!H.length||!H[0]){var ct="";nt=[];for(st in T[J])if(this.terminals_[st]&&st>W)nt.push("'"+this.terminals_[st]+"'");if(w.showPosition)ct="Parse error on line "+(V+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+nt.join(", ")+", got '"+(this.terminals_[F]||F)+"'";else ct="Parse error on line "+(V+1)+": Unexpected "+(F==X?"end of input":"'"+(this.terminals_[F]||F)+"'");this.parseError(ct,{text:w.match,token:this.terminals_[F]||F,line:w.yylineno,loc:Q,expected:nt})}if(H[0]instanceof Array&&H.length>1)throw Error("Parse Error: multiple actions possible at state: "+J+", token: "+F);switch(H[0]){case 1:if(s.push(F),k.push(w.yytext),a.push(w.yylloc),s.push(H[1]),F=null,!ot){if(P=w.yyleng,v=w.yytext,V=w.yylineno,Q=w.yylloc,C>0)C--}else F=ot,ot=null;break;case 2:if(K=this.productions_[H[1]][1],tt.$=k[k.length-K],tt._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},lt)tt._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]];if(ht=this.performAction.apply(tt,[v,P,V,B.yy,H[1],k,a].concat(rt)),typeof ht<"u")return ht;if(K)s=s.slice(0,-1*K*2),k=k.slice(0,-1*K),a=a.slice(0,-1*K);s.push(this.productions_[H[1]][0]),k.push(tt.$),a.push(tt._$),ft=T[s[s.length-2]][s[s.length-1]],s.push(ft);break;case 3:return!0}}return!0},"parse")},Z=function(){var z={EOF:1,parseError:e(function(n,s){if(this.yy.parser)this.yy.parser.parseError(n,s);else throw Error(n)},"parseError"),setInput:e(function(i,n){if(this.yy=n||this.yy||{},this._input=i,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];return this.offset=0,this},"setInput"),input:e(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);if(n)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),i},"input"),unput:e(function(i){var n=i.length,s=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var h=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1)this.yylineno-=s.length-1;var k=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-n},this.options.ranges)this.yylloc.range=[k[0],k[0]+this.yyleng-n];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(i){this.unput(this.match.slice(i))},"less"),pastInput:e(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var i=this.match;if(i.length<20)i+=this._input.substr(0,20-i.length);return(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var i=this.pastInput(),n=Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
5
|
`+n+"^"},"showPosition"),test_match:e(function(i,n){var s,h,k;if(this.options.backtrack_lexer){if(k={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)k.yylloc.range=this.yylloc.range.slice(0)}if(h=i[0].match(/(?:\r\n?|\n).*/g),h)this.yylineno+=h.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(i[0].length),this.matched+=i[0],s=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(s)return s;else if(this._backtrack){for(var a in k)this[a]=k[a];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var i,n,s,h;if(!this._more)this.yytext="",this.match="";var k=this._currentRules();for(var a=0;a<k.length;a++)if(s=this._input.match(this.rules[k[a]]),s&&(!n||s[0].length>n[0].length)){if(n=s,h=a,this.options.backtrack_lexer)if(i=this.test_match(s,k[a]),i!==!1)return i;else if(this._backtrack){n=!1;continue}else return!1;else if(!this.options.flex)break}if(n){if(i=this.test_match(n,k[h]),i!==!1)return i;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:e(function(n){this.conditionStack.push(n)},"begin"),popState:e(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:e(function(n){this.begin(n)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(n,s,h,k){var a=k;switch(h){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 z}();U.lexer=Z;function N(){this.yy={}}return e(N,"Parser"),N.prototype=U,U.Parser=N,new N}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,A()}getRoot(){return this.root}addNode(t,f){let r=y.sanitizeText(f,u());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var n=this.next();if(n)return n;else return this.lex()},"lex"),begin:e(function(n){this.conditionStack.push(n)},"begin"),popState:e(function(){var n=this.conditionStack.length-1;if(n>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(n){if(n=this.conditionStack.length-1-Math.abs(n||0),n>=0)return this.conditionStack[n];else return"INITIAL"},"topState"),pushState:e(function(n){this.begin(n)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(n,s,h,k){var a=k;switch(h){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 z}();U.lexer=Z;function N(){this.yy={}}return e(N,"Parser"),N.prototype=U,U.Parser=N,new N}();dt.parser=dt;var vt=dt,St=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{e(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,A()}getRoot(){return this.root}addNode(t,f){let r=y.sanitizeText(f,u());if(!this.root){this.root={text:r,children:[]},this.stack=[{level:0,node:this.root}],D(r);return}this.baseLevel??=t;let l=t-this.baseLevel+1;if(l<=0)l=1;while(this.stack.length>1&&this.stack[this.stack.length-1].level>=l)this.stack.pop();let o=this.stack[this.stack.length-1].node,p={text:r,children:[]};o.children.push(p),this.stack.push({level:l,node:p})}getAccTitle(){return R()}setAccTitle(t){L(t)}getAccDescription(){return M()}setAccDescription(t){I(t)}getDiagramTitle(){return O()}setDiagramTitle(t){D(t)}},Et=14,et=250,$t=30,At=60,It=5,bt=82*Math.PI/180,pt=Math.cos(bt),gt=Math.sin(bt),kt=e((t,f,r)=>{let l=t.node().getBBox(),o=l.width+f*2,p=l.height+f*2;j(t,p,o,r),t.attr("viewBox",`${l.x-f} ${l.y-f} ${o} ${p}`)},"applyPaddedViewBox"),Lt=e((t,f,r,l)=>{let p=l.db.getRoot();if(!p)return;let m=u(),{look:d,handDrawnSeed:x,themeVariables:c}=m,_=Qe(m.fontSize)[0]??Et,b=d==="handDrawn",S=p.children??[],E=m.ishikawa?.diagramPadding??20,U=m.ishikawa?.useMaxWidth??!1,Z=Y(f),N=Z.append("g").attr("class","ishikawa"),z=b?g.svg(Z.node()):void 0,i=z?{roughSvg:z,seed:x??0,lineColor:c?.lineColor??"#333",fillColor:c?.mainBkg??"#fff"}:void 0,n=`ishikawa-arrow-${f}`;if(!b)N.append("defs").append("marker").attr("id",n).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 s=0,h=et,k=b?void 0:it(N,s,h,s,h,"ishikawa-spine");if(Tt(N,s,h,p.text,_,i),!S.length){if(b)it(N,s,h,s,h,"ishikawa-spine",i);kt(Z,E,U);return}s-=20;let a=S.filter((w,B)=>B%2===0),T=S.filter((w,B)=>B%2===1),v=mt(a),V=mt(T),P=v.total+V.total,C=et,W=et;if(P>0){let w=et*2,B=et*0.3;C=Math.max(B,w*(v.total/P)),W=Math.max(B,w*(V.total/P))}let X=_*2;if(C=Math.max(C,v.max*X),W=Math.max(W,V.max*X),h=Math.max(C,et),k)k.attr("y1",h).attr("y2",h);N.select(".ishikawa-head-group").attr("transform",`translate(0,${h})`);let rt=Math.ceil(S.length/2);for(let w=0;w<rt;w++){let B=N.append("g").attr("class","ishikawa-pair");for(let[q,Q,lt]of[[S[w*2],-1,C],[S[w*2+1],1,W]])if(q)Bt(B,q,s,h,Q,lt,_,i);s=B.selectAll("text").nodes().reduce((q,Q)=>Math.min(q,Q.getBBox().x),1/0)}if(b)it(N,s,h,0,h,"ishikawa-spine",i);else{k.attr("x1",s);let w=`url(#${n})`;N.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",w)}kt(Z,E,U)},"draw"),mt=e((t)=>{let f=e((r)=>r.children.reduce((l,o)=>l+1+f(o),0),"countDescendants");return t.reduce((r,l)=>{let o=f(l);return r.total+=o,r.max=Math.max(r.max,o),r},{total:0,max:0})},"sideStats"),Tt=e((t,f,r,l,o,p)=>{let m=Math.max(6,Math.floor(110/(o*0.6))),d=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${f},${r})`),x=at(d,_t(l,m),0,0,"ishikawa-head-label","start",o),c=x.node().getBBox(),_=Math.max(60,c.width+6),b=Math.max(40,c.height*2+40),S=`M 0 ${-b/2} L 0 ${b/2} Q ${_*2.4} 0 0 ${-b/2} Z`;if(p){let E=p.roughSvg.path(S,{roughness:1.5,seed:p.seed,fill:p.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:p.lineColor,strokeWidth:2});d.insert(()=>E,":first-child").attr("class","ishikawa-head")}else d.insert("path",":first-child").attr("class","ishikawa-head").attr("d",S);x.attr("transform",`translate(${(_-c.width)/2-c.x+3},${-c.y-c.height/2})`)},"drawHead"),Mt=e((t,f)=>{let r=[],l=[],o=e((p,m,d)=>{let x=f===-1?[...p].reverse():p;for(let c of x){let _=r.length,b=c.children??[];if(r.push({depth:d,text:_t(c.text,15),parentIndex:m,childCount:b.length}),d%2===0){if(l.push(_),b.length)o(b,_,d+1)}else{if(b.length)o(b,_,d+1);l.push(_)}}},"walk");return o(t,-1,2),{entries:r,yOrder:l}},"flattenTree"),Pt=e((t,f,r,l,o,p,m)=>{let d=t.append("g").attr("class","ishikawa-label-group"),c=at(d,f,r,l+11*o,"ishikawa-label cause","middle",p).node().getBBox();if(m){let _=m.roughSvg.rectangle(c.x-20,c.y-2,c.width+40,c.height+4,{roughness:1.5,seed:m.seed,fill:m.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:m.lineColor,strokeWidth:2});d.insert(()=>_,":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"),ut=e((t,f,r,l,o,p)=>{let m=Math.sqrt(l*l+o*o);if(m===0)return;let d=l/m,x=o/m,c=6,_=-x*c,b=d*c,S=f,E=r,U=`M ${S} ${E} L ${S-d*c*2+_} ${E-x*c*2+b} L ${S-d*c*2-_} ${E-x*c*2-b} Z`,Z=p.roughSvg.path(U,{roughness:1,seed:p.seed,fill:p.lineColor,fillStyle:"solid",stroke:p.lineColor,strokeWidth:1});t.append(()=>Z)},"drawArrowMarker"),Bt=e((t,f,r,l,o,p,m,d)=>{let x=f.children??[],c=p*(x.length?1:0.2),_=-pt*c,b=gt*c*o,S=r+_,E=l+b;if(it(t,r,l,S,E,"ishikawa-branch",d),d)ut(t,r,l,r-S,l-E,d);if(Pt(t,f.text,S,E,o,m,d),!x.length)return;let{entries:U,yOrder:Z}=Mt(x,o),N=U.length,z=Array(N);for(let[k,a]of Z.entries())z[a]=l+b*((k+1)/(N+1));let i=new Map;i.set(-1,{x0:r,y0:l,x1:S,y1:E,childCount:x.length,childrenDrawn:0});let n=-pt,s=gt*o,h=o<0?"ishikawa-label up":"ishikawa-label down";for(let[k,a]of U.entries()){let T=z[k],v=i.get(a.parentIndex),V=t.append("g").attr("class","ishikawa-sub-group"),P=0,C=0,W=0;if(a.depth%2===0){let X=v.y1-v.y0;if(P=wt(v.x0,v.x1,X?(T-v.y0)/X:0.5),C=T,W=P-(a.childCount>0?At+a.childCount*It:$t),it(V,P,T,W,T,"ishikawa-sub-branch",d),d)ut(V,P,T,1,0,d);at(V,a.text,W,T,"ishikawa-label align","end",m)}else{let X=v.childrenDrawn++;if(P=wt(v.x0,v.x1,(v.childCount-X)/(v.childCount+1)),C=v.y0,W=P+n*((T-C)/s),it(V,P,C,W,T,"ishikawa-sub-branch",d),d)ut(V,P,C,P-W,C-T,d);at(V,a.text,W,T,h,"end",m)}if(a.childCount>0)i.set(k,{x0:P,y0:C,x1:W,y1:T,childCount:a.childCount,childrenDrawn:0})}},"drawBranch"),Nt=e((t)=>t.split(/<br\s*\/?>|\n/),"splitLines"),_t=e((t,f)=>{if(t.length<=f)return t;let r=[];for(let l of t.split(/\s+/)){let o=r.length-1;if(o>=0&&r[o].length+1+l.length<=f)r[o]+=" "+l;else r.push(l)}return r.join(`
|
|
7
7
|
`)},"wrapText"),at=e((t,f,r,l,o,p,m)=>{let d=Nt(f),x=m*1.05,c=t.append("text").attr("class",o).attr("text-anchor",p).attr("x",r).attr("y",l-(d.length-1)*x/2);for(let[_,b]of d.entries())c.append("tspan").attr("x",r).attr("dy",_===0?0:x).text(b);return c},"drawMultilineText"),wt=e((t,f,r)=>t+(f-t)*r,"lerp"),it=e((t,f,r,l,o,p,m)=>{if(m){let d=m.roughSvg.line(f,r,l,o,{roughness:1.5,seed:m.seed,stroke:m.lineColor,strokeWidth:2});t.append(()=>d).attr("class",p);return}return t.append("line").attr("class",p).attr("x1",f).attr("y1",r).attr("x2",l).attr("y2",o)},"drawLine"),Dt={draw:Lt},Ot=e((t)=>`
|
|
8
8
|
.ishikawa .ishikawa-spine,
|
|
9
9
|
.ishikawa .ishikawa-branch,
|
package/dist/chunks/{journeyDiagram-POQNLL5X.2c9swtn6.js → journeyDiagram-POQNLL5X.55cqc9p0.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{e,j,A,L,I,
|
|
1
|
+
import{e,j,A,L,R,I,M,D,O,u,m,Qt}from"./index.a1bxkgd3.js";import{_r,Ca,ul,ct}from"./index.0e4s8r4m.js";import{Xe}from"./index.dnnzjw18.js";var nt=function(){var t=e(function(h,n,s,l){for(s=s||{},l=h.length;l--;s[h[l]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],p=[1,10],i=[1,11],y=[1,12],g=[1,13],o=[1,14],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(n,s,l,d,f,c,w){var _=c.length-1;switch(f){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 13:d.addTask(c[_-1],c[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:p,14:i,16:y,17:g,18:o},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:15,11:a,12:p,14:i,16:y,17:g,18:o},t(r,[2,5]),t(r,[2,6]),t(r,[2,8]),{13:[1,16]},{15:[1,17]},t(r,[2,11]),t(r,[2,12]),{19:[1,18]},t(r,[2,4]),t(r,[2,9]),t(r,[2,10]),t(r,[2,13])],defaultActions:{},parseError:e(function(n,s){if(s.recoverable)this.trace(n);else{var l=Error(n);throw l.hash=s,l}},"parseError"),parse:e(function(n){var s=this,l=[0],d=[],f=[null],c=[],w=this.table,_="",B=0,ot=0,ht=0,vt=2,ut=1,wt=c.slice.call(arguments,1),v=Object.create(this.lexer),z={yy:{}};for(var K in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,K))z.yy[K]=this.yy[K];if(v.setInput(n,z.yy),z.yy.lexer=v,z.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var Q=v.yylloc;c.push(Q);var Tt=v.options&&v.options.ranges;if(typeof z.yy.parseError==="function")this.parseError=z.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function St(E){l.length=l.length-2*E,f.length=f.length-E,c.length=c.length-E}e(St,"popStack");function yt(){var E=d.pop()||v.lex()||ut;if(typeof E!=="number"){if(E instanceof Array)d=E,E=d.pop();E=s.symbols_[E]||E}return E}e(yt,"lex");var T,tt,W,S,Gt,et,Y={},U,F,dt,Z;while(!0){if(W=l[l.length-1],this.defaultActions[W])S=this.defaultActions[W];else{if(T===null||typeof T>"u")T=yt();S=w[W]&&w[W][T]}if(typeof S>"u"||!S.length||!S[0]){var rt="";Z=[];for(U in w[W])if(this.terminals_[U]&&U>vt)Z.push("'"+this.terminals_[U]+"'");if(v.showPosition)rt="Parse error on line "+(B+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+Z.join(", ")+", got '"+(this.terminals_[T]||T)+"'";else rt="Parse error on line "+(B+1)+": Unexpected "+(T==ut?"end of input":"'"+(this.terminals_[T]||T)+"'");this.parseError(rt,{text:v.match,token:this.terminals_[T]||T,line:v.yylineno,loc:Q,expected:Z})}if(S[0]instanceof Array&&S.length>1)throw Error("Parse Error: multiple actions possible at state: "+W+", token: "+T);switch(S[0]){case 1:if(l.push(T),f.push(v.yytext),c.push(v.yylloc),l.push(S[1]),T=null,!tt){if(ot=v.yyleng,_=v.yytext,B=v.yylineno,Q=v.yylloc,ht>0)ht--}else T=tt,tt=null;break;case 2:if(F=this.productions_[S[1]][1],Y.$=f[f.length-F],Y._$={first_line:c[c.length-(F||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(F||1)].first_column,last_column:c[c.length-1].last_column},Tt)Y._$.range=[c[c.length-(F||1)].range[0],c[c.length-1].range[1]];if(et=this.performAction.apply(Y,[_,ot,B,z.yy,S[1],f,c].concat(wt)),typeof et<"u")return et;if(F)l=l.slice(0,-1*F*2),f=f.slice(0,-1*F),c=c.slice(0,-1*F);l.push(this.productions_[S[1]][0]),f.push(Y.$),c.push(Y._$),dt=w[l[l.length-2]][l[l.length-1]],l.push(dt);break;case 3:return!0}}return!0},"parse")},k=function(){var h={EOF:1,parseError:e(function(s,l){if(this.yy.parser)this.yy.parser.parseError(s,l);else throw Error(s)},"parseError"),setInput:e(function(n,s){if(this.yy=s||this.yy||{},this._input=n,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];return this.offset=0,this},"setInput"),input:e(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var s=n.match(/(?:\r\n?|\n).*/g);if(s)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:e(function(n){var s=n.length,l=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var d=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1)this.yylineno-=l.length-1;var f=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-s},this.options.ranges)this.yylloc.range=[f[0],f[0]+this.yyleng-s];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(n){this.unput(this.match.slice(n))},"less"),pastInput:e(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var n=this.pastInput(),s=Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
5
|
`+s+"^"},"showPosition"),test_match:e(function(n,s){var l,d,f;if(this.options.backtrack_lexer){if(f={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)f.yylloc.range=this.yylloc.range.slice(0)}if(d=n[0].match(/(?:\r\n?|\n).*/g),d)this.yylineno+=d.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],l=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(l)return l;else if(this._backtrack){for(var c in f)this[c]=f[c];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var n,s,l,d;if(!this._more)this.yytext="",this.match="";var f=this._currentRules();for(var c=0;c<f.length;c++)if(l=this._input.match(this.rules[f[c]]),l&&(!s||l[0].length>s[0].length)){if(s=l,d=c,this.options.backtrack_lexer)if(n=this.test_match(l,f[c]),n!==!1)return n;else if(this._backtrack){s=!1;continue}else return!1;else if(!this.options.flex)break}if(s){if(n=this.test_match(s,f[d]),n!==!1)return n;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var s=this.next();if(s)return s;else return this.lex()},"lex"),begin:e(function(s){this.conditionStack.push(s)},"begin"),popState:e(function(){var s=this.conditionStack.length-1;if(s>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(s){if(s=this.conditionStack.length-1-Math.abs(s||0),s>=0)return this.conditionStack[s];else return"INITIAL"},"topState"),pushState:e(function(s){this.begin(s)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(s,l,d,f){var c=f;switch(d){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h}();x.lexer=k;function b(){this.yy={}}return e(b,"Parser"),b.prototype=x,x.Parser=b,new b}();nt.parser=nt;var $t=nt,q="",at=[],X=[],G=[],Mt=e(function(){at.length=0,X.length=0,q="",G.length=0,A()},"clear"),Et=e(function(t){q=t,at.push(t)},"addSection"),Ct=e(function(){return at},"getSections"),Pt=e(function(){let t=ft(),r=100,a=0;while(!t&&a<r)t=ft(),a++;return X.push(...G),X},"getTasks"),It=e(function(){let t=[];return X.forEach((a)=>{if(a.people)t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),At=e(function(t,r){let a=r.substr(1).split(":"),p=0,i=[];if(a.length===1)p=Number(a[0]),i=[];else p=Number(a[0]),i=a[1].split(",");let y=i.map((o)=>o.trim()),g={section:q,type:q,people:y,task:t,score:p};G.push(g)},"addTask"),Ft=e(function(t){let r={section:q,type:q,description:t,task:t,classes:[]};X.push(r)},"addTaskOrg"),ft=e(function(){let t=e(function(a){return G[a].processed},"compileTask"),r=!0;for(let[a,p]of G.entries())t(a),r=r&&p.processed;return r},"compileTasks"),Vt=e(function(){return It()},"getActors"),pt={getConfig:e(()=>u().journey,"getConfig"),clear:Mt,setDiagramTitle:
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var s=this.next();if(s)return s;else return this.lex()},"lex"),begin:e(function(s){this.conditionStack.push(s)},"begin"),popState:e(function(){var s=this.conditionStack.length-1;if(s>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(s){if(s=this.conditionStack.length-1-Math.abs(s||0),s>=0)return this.conditionStack[s];else return"INITIAL"},"topState"),pushState:e(function(s){this.begin(s)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:e(function(s,l,d,f){var c=f;switch(d){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;break;case 8:return this.popState(),"acc_title_value";break;case 9:return this.begin("acc_descr"),14;break;case 10:return this.popState(),"acc_descr_value";break;case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h}();x.lexer=k;function b(){this.yy={}}return e(b,"Parser"),b.prototype=x,x.Parser=b,new b}();nt.parser=nt;var $t=nt,q="",at=[],X=[],G=[],Mt=e(function(){at.length=0,X.length=0,q="",G.length=0,A()},"clear"),Et=e(function(t){q=t,at.push(t)},"addSection"),Ct=e(function(){return at},"getSections"),Pt=e(function(){let t=ft(),r=100,a=0;while(!t&&a<r)t=ft(),a++;return X.push(...G),X},"getTasks"),It=e(function(){let t=[];return X.forEach((a)=>{if(a.people)t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),At=e(function(t,r){let a=r.substr(1).split(":"),p=0,i=[];if(a.length===1)p=Number(a[0]),i=[];else p=Number(a[0]),i=a[1].split(",");let y=i.map((o)=>o.trim()),g={section:q,type:q,people:y,task:t,score:p};G.push(g)},"addTask"),Ft=e(function(t){let r={section:q,type:q,description:t,task:t,classes:[]};X.push(r)},"addTaskOrg"),ft=e(function(){let t=e(function(a){return G[a].processed},"compileTask"),r=!0;for(let[a,p]of G.entries())t(a),r=r&&p.processed;return r},"compileTasks"),Vt=e(function(){return It()},"getActors"),pt={getConfig:e(()=>u().journey,"getConfig"),clear:Mt,setDiagramTitle:D,getDiagramTitle:O,setAccTitle:L,getAccTitle:R,setAccDescription:I,getAccDescription:M,addSection:Et,getSections:Ct,getTasks:Pt,addTask:At,addTaskOrg:Ft,getActors:Vt},Rt=e((t)=>`.label {
|
|
7
7
|
font-family: ${t.fontFamily};
|
|
8
8
|
color: ${t.textColor};
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,n,ae,h,p,F,q,Tt,u,Y,ut,dt,Ft,St,gr}from"./index.
|
|
1
|
+
import{e,n,ae,h,p,F,q,Tt,u,Y,ut,dt,Ft,St,gr}from"./index.a1bxkgd3.js";import{Xe}from"./index.dnnzjw18.js";var se=function(){var t=e(function(A,s,r,o){for(r=r||{},o=A.length;o--;r[A[o]]=s);return r},"o"),f=[1,4],m=[1,13],a=[1,12],y=[1,15],N=[1,16],S=[1,20],g=[1,19],C=[6,7,8],T=[1,26],b=[1,24],P=[1,25],x=[6,7,11],z=[1,31],D=[6,7,11,24],U=[1,6,13,16,17,20,23],k=[1,35],V=[1,36],w=[1,6,7,11,13,16,17,20,23],X=[1,38],B={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},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,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:e(function(s,r,o,c,d,i,j){var l=i.length-1;switch(d){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",i[l-1].id),c.addNode(i[l-2].length,i[l-1].id,i[l-1].descr,i[l-1].type,i[l]);break;case 16:c.getLogger().info("Node: ",i[l].id),c.addNode(i[l-1].length,i[l].id,i[l].descr,i[l].type);break;case 17:c.getLogger().trace("Icon: ",i[l]),c.decorateNode({icon:i[l]});break;case 18:case 23:c.decorateNode({class:i[l]});break;case 19:c.getLogger().trace("SPACELIST");break;case 20:c.getLogger().trace("Node: ",i[l-1].id),c.addNode(0,i[l-1].id,i[l-1].descr,i[l-1].type,i[l]);break;case 21:c.getLogger().trace("Node: ",i[l].id),c.addNode(0,i[l].id,i[l].descr,i[l].type);break;case 22:c.decorateNode({icon:i[l]});break;case 27:c.getLogger().trace("node found ..",i[l-2]),this.$={id:i[l-1],descr:i[l-1],type:c.getType(i[l-2],i[l])};break;case 28:this.$={id:i[l],descr:i[l],type:0};break;case 29:c.getLogger().trace("node found ..",i[l-3]),this.$={id:i[l-3],descr:i[l-1],type:c.getType(i[l-2],i[l])};break;case 30:this.$=i[l-1]+i[l];break;case 31:this.$=i[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:f},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:f},{6:m,7:[1,10],9:9,12:11,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},t(C,[2,3]),{1:[2,2]},t(C,[2,4]),t(C,[2,5]),{1:[2,6],6:m,12:21,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:m,9:22,12:11,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},{6:T,7:b,10:23,11:P},t(x,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:S,23:g}),t(x,[2,19]),t(x,[2,21],{15:30,24:z}),t(x,[2,22]),t(x,[2,23]),t(D,[2,25]),t(D,[2,26]),t(D,[2,28],{20:[1,32]}),{21:[1,33]},{6:T,7:b,10:34,11:P},{1:[2,7],6:m,12:21,13:a,14:14,16:y,17:N,18:17,19:18,20:S,23:g},t(U,[2,14],{7:k,11:V}),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(x,[2,16],{15:37,24:z}),t(x,[2,17]),t(x,[2,18]),t(x,[2,20],{24:X}),t(D,[2,31]),{21:[1,39]},{22:[1,40]},t(U,[2,13],{7:k,11:V}),t(w,[2,11]),t(w,[2,12]),t(x,[2,15],{24:X}),t(D,[2,30]),{22:[1,41]},t(D,[2,27]),t(D,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(s,r){if(r.recoverable)this.trace(s);else{var o=Error(s);throw o.hash=r,o}},"parseError"),parse:e(function(s){var r=this,o=[0],c=[],d=[null],i=[],j=this.table,l="",K=0,he=0,ue=0,be=2,ge=1,ye=i.slice.call(arguments,1),_=Object.create(this.lexer),G={yy:{}};for(var ee in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,ee))G.yy[ee]=this.yy[ee];if(_.setInput(s,G.yy),G.yy.lexer=_,G.yy.parser=this,typeof _.yylloc>"u")_.yylloc={};var te=_.yylloc;i.push(te);var me=_.options&&_.options.ranges;if(typeof G.yy.parseError==="function")this.parseError=G.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function ke(O){o.length=o.length-2*O,d.length=d.length-O,i.length=i.length-O}e(ke,"popStack");function de(){var O=c.pop()||_.lex()||ge;if(typeof O!=="number"){if(O instanceof Array)c=O,O=c.pop();O=r.symbols_[O]||O}return O}e(de,"lex");var v,ne,M,L,je,ie,W={},J,R,pe,Q;while(!0){if(M=o[o.length-1],this.defaultActions[M])L=this.defaultActions[M];else{if(v===null||typeof v>"u")v=de();L=j[M]&&j[M][v]}if(typeof L>"u"||!L.length||!L[0]){var re="";Q=[];for(J in j[M])if(this.terminals_[J]&&J>be)Q.push("'"+this.terminals_[J]+"'");if(_.showPosition)re="Parse error on line "+(K+1)+`:
|
|
2
2
|
`+_.showPosition()+`
|
|
3
3
|
Expecting `+Q.join(", ")+", got '"+(this.terminals_[v]||v)+"'";else re="Parse error on line "+(K+1)+": Unexpected "+(v==ge?"end of input":"'"+(this.terminals_[v]||v)+"'");this.parseError(re,{text:_.match,token:this.terminals_[v]||v,line:_.yylineno,loc:te,expected:Q})}if(L[0]instanceof Array&&L.length>1)throw Error("Parse Error: multiple actions possible at state: "+M+", token: "+v);switch(L[0]){case 1:if(o.push(v),d.push(_.yytext),i.push(_.yylloc),o.push(L[1]),v=null,!ne){if(he=_.yyleng,l=_.yytext,K=_.yylineno,te=_.yylloc,ue>0)ue--}else v=ne,ne=null;break;case 2:if(R=this.productions_[L[1]][1],W.$=d[d.length-R],W._$={first_line:i[i.length-(R||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(R||1)].first_column,last_column:i[i.length-1].last_column},me)W._$.range=[i[i.length-(R||1)].range[0],i[i.length-1].range[1]];if(ie=this.performAction.apply(W,[l,he,K,G.yy,L[1],d,i].concat(ye)),typeof ie<"u")return ie;if(R)o=o.slice(0,-1*R*2),d=d.slice(0,-1*R),i=i.slice(0,-1*R);o.push(this.productions_[L[1]][0]),d.push(W.$),i.push(W._$),pe=j[o[o.length-2]][o[o.length-1]],o.push(pe);break;case 3:return!0}}return!0},"parse")},Z=function(){var A={EOF:1,parseError:e(function(r,o){if(this.yy.parser)this.yy.parser.parseError(r,o);else throw Error(r)},"parseError"),setInput:e(function(s,r){if(this.yy=r||this.yy||{},this._input=s,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];return this.offset=0,this},"setInput"),input:e(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var r=s.match(/(?:\r\n?|\n).*/g);if(r)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),s},"input"),unput:e(function(s){var r=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var c=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var d=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges)this.yylloc.range=[d[0],d[0]+this.yyleng-r];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(s){this.unput(this.match.slice(s))},"less"),pastInput:e(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var s=this.match;if(s.length<20)s+=this._input.substr(0,20-s.length);return(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var s=this.pastInput(),r=Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{de,ye,f,ie,d,l,w,i,o,r,a}from"./index.5vcex75v.js";function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var p in s)({}).hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},c.apply(null,arguments)}function U(t,e){if(t==null)return{};var s={};for(var p in t)if({}.hasOwnProperty.call(t,p)){if(e.indexOf(p)!==-1)continue;s[p]=t[p]}return s}var or=255,fr=360,Y=100,er=(t)=>{var{r:e,g:s,b:p,a:b}=t,n=Math.max(e,s,p),v=n-Math.min(e,s,p),x=v?n===e?(s-p)/v:n===s?2+(p-e)/v:4+(e-s)/v:0;return{h:60*(x<0?x+6:x),s:n?v/n*Y:0,v:n/or*Y,a:b}},Rr=(t)=>{var e=hr(t),{h:s,s:p,l:b,a:n}=e;return"hsla("+s+", "+p+"%, "+b+"%, "+n+")"},sr=(t)=>{var{h:e,s,l:p,a:b}=t;return s*=(p<50?p:Y-p)/Y,{h:e,s:s>0?2*s/(p+s)*Y:0,v:p+s,a:b}},hr=(t)=>{var{h:e,s,v:p,a:b}=t,n=(200-s)*p/Y;return{h:e,s:n>0&&n<200?s*p/Y/(n<=Y?n:200-n)*Y:0,l:n/2,a:b}};fr/400,fr/(Math.PI*2);var Br=(t)=>{var{r:e,g:s,b:p}=t;return"#"+((b)=>Array(7-b.length).join("0")+b)((e<<16|s<<8|p).toString(16))},kr=(t)=>{var{r:e,g:s,b:p,a:b}=t,n=typeof b=="number"&&(b*255|256).toString(16).slice(1);return""+Br({r:e,g:s,b:p})+(n||"")},Z=(t)=>er(Mr(t)),Mr=(t)=>{var e=t.replace("#","");/^#?/.test(t)&&e.length===3&&(t="#"+e.charAt(0)+e.charAt(0)+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2));var s=RegExp("[A-Za-z0-9]{2}","g"),p=t.match(s).map((x)=>parseInt(x,16)),b=p[0],n=p[1],v=p[2];return{r:b,g:n,b:v===void 0?0:v,a:(p[3]??255)/or}},nr=(t)=>{var{h:e,s,v:p,a:b}=t,n=e/60,v=s/Y,x=p/Y,A=Math.floor(n)%6;A<0&&(A+=6);var R=n-Math.floor(n),L=or*x*(1-v),y=or*x*(1-v*R),k=or*x*(1-v*(1-R));x*=or;var C={};switch(A){case 0:C.r=x,C.g=k,C.b=L;break;case 1:C.r=y,C.g=x,C.b=L;break;case 2:C.r=L,C.g=x,C.b=k;break;case 3:C.r=L,C.g=y,C.b=x;break;case 4:C.r=k,C.g=L,C.b=x;break;case 5:C.r=x,C.g=L,C.b=y}return C.r=Math.round(C.r),C.g=Math.round(C.g),C.b=Math.round(C.b),c({},C,{a:b})},zr=(t)=>{var e=nr(t),{r:s,g:p,b,a:n}=e;return"rgba("+s+", "+p+", "+b+", "+n+")"},Ir=(t)=>({r:t.r,g:t.g,b:t.b}),Hr=(t)=>({h:t.h,s:t.s,l:t.l}),cr=(t)=>Br(nr(t)),jr=(t)=>kr(nr(t)),Fr=(t)=>({h:t.h,s:t.s,v:t.v}),Gr=(t)=>{var{r:e,g:s,b:p}=t,b=function(R){return R<=0.04045?R/12.92:((R+0.055)/1.055)**2.4},n=b(e/255),v=b(s/255),x=b(p/255),A={};return A.x=n*0.4124+v*0.3576+x*0.1805,A.y=n*0.2126+v*0.7152+x*0.0722,A.bri=n*0.0193+v*0.1192+x*0.9505,A},_=(t)=>{var e,s,p,b,n,v,x,A,R;return typeof t=="string"&&ur(t)?(v=Z(t),A=t):typeof t!="string"&&(v=t),v&&(p=Fr(v),n=hr(v),b=nr(v),R=kr(b),A=cr(v),s=Hr(n),e=Ir(b),x=Gr(e)),{rgb:e,hsl:s,hsv:p,rgba:b,hsla:n,hsva:v,hex:A,hexa:R,xy:x}},ur=(t)=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(t);function Or(t){if(t==null)throw TypeError("Cannot destructure "+t)}var Wr=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],Sr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-swatch":s,{className:b,color:n,colors:v}=t,x=v===void 0?[]:v,{style:A,rectProps:R}=t,L=R===void 0?{}:R,{onChange:y,addonAfter:k,addonBefore:C,rectRender:D}=t,T=U(t,Wr),S=c({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},L.style),B=(N,u)=>{y&&y(Z(N),_(Z(N)),u)};return a("div",c({ref:e},T,{className:[p,b||""].filter(Boolean).join(" "),style:c({display:"flex",flexWrap:"wrap",position:"relative"},A),children:[C&&ie(C)&&C,x&&Array.isArray(x)&&x.map((N,u)=>{var E="",g="";typeof N=="string"&&(E=N,g=N),typeof N=="object"&&N.color&&(E=N.title||N.color,g=N.color);var M=n&&n.toLocaleLowerCase()===g.toLocaleLowerCase(),m=D&&D({title:E,color:g,checked:!!M,style:c({},S,{background:g}),onClick:(P)=>B(g,P)});if(m)return r(de,{children:m},u);var h=L.children&&ie(L.children)?ye(L.children,{color:g,checked:M}):null;return r("div",c({tabIndex:0,title:E,onClick:(P)=>B(g,P)},L,{children:h,style:c({},S,{background:g})}),u)}),k&&ie(k)&&k]}))});Sr.displayName="Swatch";var Ur={marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25};function Xr(t){var{style:e,title:s,checked:p}=t;t.color;var{onClick:b,rectProps:n}=t,v=i(null),x=d(()=>{v.current.style.zIndex="2",v.current.style.outline="#fff solid 2px",v.current.style.boxShadow="rgb(0 0 0 / 25%) 0 0 5px 2px"},[]),A=d(()=>{p||(v.current.style.zIndex="0",v.current.style.outline="initial",v.current.style.boxShadow="initial")},[p]);return r("div",c({ref:v,title:s},n,{onClick:b,onMouseEnter:x,onMouseLeave:A,style:c({},e,{marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25},Ur,p?{zIndex:1,outline:"#fff solid 2px",boxShadow:"rgb(0 0 0 / 25%) 0 0 5px 2px"}:{zIndex:0},n?.style)}))}var Yr=["prefixCls","placement","className","style","color","colors","showTriangle","rectProps","onChange","rectRender"],_r=["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],I=function(t){return t.Left="L",t.LeftTop="LT",t.LeftBottom="LB",t.Right="R",t.RightTop="RT",t.RightBottom="RB",t.Top="T",t.TopRight="TR",t.TopLeft="TL",t.Bottom="B",t.BottomLeft="BL",t.BottomRight="BR",t}({}),Pr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-github":s,b=t.placement,n=b===void 0?I.TopRight:b,{className:v,style:x,color:A,colors:R}=t,L=R===void 0?_r:R,y=t.showTriangle,k=y===void 0||y,C=t.rectProps,D=C===void 0?{}:C,{onChange:T,rectRender:S}=t,B=U(t,Yr),N=typeof A=="string"&&ur(A)?Z(A):A,u=A?cr(N):"",E=(P)=>T&&T(_(P)),g=c({"--github-border":"1px solid rgba(0, 0, 0, 0.2)","--github-background-color":"#fff","--github-box-shadow":"rgb(0 0 0 / 15%) 0px 3px 12px","--github-arrow-border-color":"rgba(0, 0, 0, 0.15)",width:200,borderRadius:4,background:"var(--github-background-color)",boxShadow:"var(--github-box-shadow)",border:"var(--github-border)",position:"relative",padding:5},x),M={borderStyle:"solid",position:"absolute"},m=c({},M),h=c({},M);return/^T/.test(n)&&(m.borderWidth="0 8px 8px",m.borderColor="transparent transparent var(--github-arrow-border-color)",h.borderWidth="0 7px 7px",h.borderColor="transparent transparent var(--github-background-color)"),n===I.TopRight&&(m.top=-8,h.top=-7),n===I.Top&&(m.top=-8,h.top=-7),n===I.TopLeft&&(m.top=-8,h.top=-7),/^B/.test(n)&&(m.borderWidth="8px 8px 0",m.borderColor="var(--github-arrow-border-color) transparent transparent",h.borderWidth="7px 7px 0",h.borderColor="var(--github-background-color) transparent transparent",n===I.BottomRight&&(m.top="100%",h.top="100%"),n===I.Bottom&&(m.top="100%",h.top="100%"),n===I.BottomLeft&&(m.top="100%",h.top="100%")),/^(B|T)/.test(n)&&((n===I.Top||n===I.Bottom)&&(m.left="50%",m.marginLeft=-8,h.left="50%",h.marginLeft=-7),(n===I.TopRight||n===I.BottomRight)&&(m.right=10,h.right=11),(n===I.TopLeft||n===I.BottomLeft)&&(m.left=7,h.left=8)),/^L/.test(n)&&(m.borderWidth="8px 8px 8px 0",m.borderColor="transparent var(--github-arrow-border-color) transparent transparent",h.borderWidth="7px 7px 7px 0",h.borderColor="transparent var(--github-background-color) transparent transparent",m.left=-8,h.left=-7),/^R/.test(n)&&(m.borderWidth="8px 0 8px 8px",m.borderColor="transparent transparent transparent var(--github-arrow-border-color)",h.borderWidth="7px 0 7px 7px",h.borderColor="transparent transparent transparent var(--github-background-color)",m.right=-8,h.right=-7),/^(L|R)/.test(n)&&((n===I.RightTop||n===I.LeftTop)&&(m.top=5,h.top=6),(n===I.Left||n===I.Right)&&(m.top="50%",h.top="50%",m.marginTop=-8,h.marginTop=-7),(n===I.LeftBottom||n===I.RightBottom)&&(m.top="100%",h.top="100%",m.marginTop=-21,h.marginTop=-20)),r(Sr,c({ref:e,className:[p,v].filter(Boolean).join(" "),colors:L,color:u,rectRender:(P)=>{var j=c({},(Or(P),P));return S&&S(c({},j))||r(Xr,c({},j,{rectProps:D}))}},B,{onChange:E,style:g,rectProps:{style:{marginRight:0,marginBottom:0,borderRadius:0,height:25,width:25}},addonBefore:r(de,{children:k&&a(de,{children:[r("div",{style:m}),r("div",{style:h})]})})}))});Pr.displayName="Github";function mr(t){var e=i(t);return l(()=>{e.current=t}),d((s,p)=>e.current&&e.current(s,p),[])}var ar=(t)=>("touches"in t),xr=(t)=>{!ar(t)&&t.preventDefault&&t.preventDefault()},yr=function(t,e,s){return e===void 0&&(e=0),s===void 0&&(s=1),t>s?s:t<e?e:t},wr=(t,e)=>{var s=t.getBoundingClientRect(),p=ar(e)?e.touches[0]:e;return{left:yr((p.pageX-(s.left+window.pageXOffset))/s.width),top:yr((p.pageY-(s.top+window.pageYOffset))/s.height),width:s.width,height:s.height,x:p.pageX-(s.left+window.pageXOffset),y:p.pageY-(s.top+window.pageYOffset)}},Vr=["prefixCls","className","onMove","onDown"],gr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-interactive":s,{className:b,onMove:n,onDown:v}=t,x=U(t,Vr),A=i(null),R=i(!1),L=o(!1),y=L[0],k=L[1],C=mr(n),D=mr(v),T=(g)=>R.current&&!ar(g)?!1:(R.current=ar(g),!0),S=d((g)=>{xr(g),A.current&&((ar(g)?g.touches.length>0:g.buttons>0)?C?.(wr(A.current,g),g):k(!1))},[C]),B=d(()=>k(!1),[]),N=d((g)=>{g?(window.addEventListener(R.current?"touchmove":"mousemove",S),window.addEventListener(R.current?"touchend":"mouseup",B)):(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",B),window.removeEventListener("touchmove",S),window.removeEventListener("touchend",B))},[S,B]);l(()=>(N(y),()=>{N(!1)}),[y,S,B,N]);var u=d((g)=>{document.activeElement?.blur(),xr(g.nativeEvent),T(g.nativeEvent)&&A.current&&(D?.(wr(A.current,g.nativeEvent),g.nativeEvent),k(!0))},[D]),E=d((g)=>{A.current=g,typeof e=="function"?e(g):e&&(e.current=g)},[e]);return r("div",c({},x,{className:[p,b||""].filter(Boolean).join(" "),style:c({},x.style,{touchAction:"none"}),ref:E,tabIndex:0,onMouseDown:u,onTouchStart:u}))});gr.displayName="Interactive";var Jr=(t)=>{var{className:e,color:s,left:p,top:b,prefixCls:n}=t,v={position:"absolute",top:b,left:p},x={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:s};return w(()=>r("div",{className:n+"-pointer "+(e||""),style:v,children:r("div",{className:n+"-fill",style:x})}),[b,p,s,e,n])},Kr=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],Nr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-saturation":s,b=t.radius,n=b===void 0?0:b,{pointer:v,className:x,hue:A}=t,R=A===void 0?0:A,{style:L,hsva:y,onChange:k}=t,C=U(t,Kr),D=c({width:200,height:200,borderRadius:n},L,{position:"relative"}),T=i(null),S=d((g)=>{T.current=g,typeof e=="function"?e(g):e&&("current"in e)&&(e.current=g)},[e]),B=d((g,M)=>{k&&y&&k({h:y.h,s:g.left*100,v:(1-g.top)*100,a:y.a});var m=T.current;m&&m.focus()},[y,k]),N=d((g)=>{if(y&&k){var M=1,{s:m,v:h}=y;switch(g.key){case"ArrowLeft":m=Math.max(0,y.s-M),g.preventDefault();break;case"ArrowRight":m=Math.min(100,y.s+M),g.preventDefault();break;case"ArrowUp":h=Math.min(100,y.v+M),g.preventDefault();break;case"ArrowDown":h=Math.max(0,y.v-M),g.preventDefault();break;default:return}k({h:y.h,s:m,v:h,a:y.a})}},[y,k]),u=w(()=>{if(!y)return null;var g={top:100-y.v+"%",left:y.s+"%",color:Rr(y)};return v&&typeof v=="function"?v(c({prefixCls:p},g)):r(Jr,c({prefixCls:p},g))},[y,v,p]),E=d((g)=>{g.target.focus()},[]);return r(gr,c({className:[p,x||""].filter(Boolean).join(" ")},C,{style:c({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(y?.h??R)+", 100%, 50%))"},D,{outline:"none"}),ref:S,onMove:B,onDown:B,onKeyDown:N,onClick:E,children:u}))});Nr.displayName="Saturation";var Qr=["className","prefixCls","left","top","style","fillProps"],Zr=(t)=>{var{className:e,prefixCls:s,left:p,top:b,style:n,fillProps:v}=t,x=U(t,Qr),A=c({},n,{position:"absolute",left:p,top:b}),R=c({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},v?.style,{transform:p?"translate(-9px, -1px)":"translate(-1px, -9px)"});return r("div",c({className:s+"-pointer "+(e||""),style:A},x,{children:r("div",c({className:s+"-fill"},v,{style:R}))}))},$r=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","reverse","style","onChange","pointer"],qr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",pr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-alpha":s,{className:b,hsva:n,background:v,bgProps:x}=t,A=x===void 0?{}:x,R=t.innerProps,L=R===void 0?{}:R,y=t.pointerProps,k=y===void 0?{}:y,C=t.radius,D=C===void 0?0:C,{width:T,height:S}=t,B=S===void 0?16:S,N=t.direction,u=N===void 0?"horizontal":N,E=t.reverse,g=E!==void 0&&E,{style:M,onChange:m,pointer:h}=t,P=U(t,$r),j=d((H)=>{var O=u==="horizontal"?H.left:H.top;return u==="horizontal"?g?1-O:O:g?O:1-O},[u,g]),X=d((H)=>u==="horizontal"?g?1-H:H:g?H:1-H,[u,g]),W=(H)=>{var O=j(H);m&&m(c({},n,{a:O}),H)},z=Rr(Object.assign({},n,{a:1})),F=g?"linear-gradient(to right, "+z+" 0%, rgba(244, 67, 54, 0) 100%)":"linear-gradient(to right, rgba(244, 67, 54, 0) 0%, "+z+" 100%)",q=g?"linear-gradient(to bottom, rgba(244, 67, 54, 0) 0%, "+z+" 100%)":"linear-gradient(to bottom, "+z+" 0%, rgba(244, 67, 54, 0) 100%)",dr=u==="horizontal"?F:q,rr={};u==="horizontal"?rr.left=X(n.a)*100+"%":rr.top=X(n.a)*100+"%";var lr=c({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:D,background:"url("+qr+") left center",backgroundColor:"var(--alpha-background-color)"},{width:T,height:B},M,{position:"relative"}),ir=d((H)=>{var O=0.01,V=n.a,Q=V;switch(H.key){case"ArrowLeft":u==="horizontal"&&(Q=g?Math.min(1,V+O):Math.max(0,V-O),H.preventDefault());break;case"ArrowRight":u==="horizontal"&&(Q=g?Math.max(0,V-O):Math.min(1,V+O),H.preventDefault());break;case"ArrowUp":u==="vertical"&&(Q=g?Math.max(0,V-O):Math.min(1,V+O),H.preventDefault());break;case"ArrowDown":u==="vertical"&&(Q=g?Math.min(1,V+O):Math.max(0,V-O),H.preventDefault());break;default:return}if(Q!==V){var br=X(Q),Tr={left:u==="horizontal"?br:n.a,top:u==="vertical"?br:n.a,width:0,height:0,x:0,y:0};m&&m(c({},n,{a:Q}),Tr)}},[X,n,u,m,g]),G=d((H)=>{H.target.focus()},[]),K=h&&typeof h=="function"?h(c({prefixCls:p},k,rr)):r(Zr,c({},k,{prefixCls:p},rr));return a("div",c({},P,{className:[p,p+"-"+u,b||""].filter(Boolean).join(" "),style:lr,ref:e,children:[r("div",c({},A,{style:c({inset:0,position:"absolute",background:v||dr,borderRadius:D},A.style)})),r(gr,c({},L,{style:c({},L.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:W,onDown:W,onClick:G,onKeyDown:ir,children:K}))]}))});pr.displayName="Alpha";var ro=["prefixCls","className","hue","onChange","direction","reverse"],Cr="rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%",Ar="rgb(255, 0, 0) 0%, rgb(255, 0, 255) 17%, rgb(0, 0, 255) 33%, rgb(0, 255, 255) 50%, rgb(0, 255, 0) 67%, rgb(255, 255, 0) 83%, rgb(255, 0, 0) 100%",Lr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-hue":s,{className:b,hue:n}=t,v=n===void 0?0:n,{onChange:x,direction:A}=t,R=A===void 0?"horizontal":A,L=t.reverse,y=L!==void 0&&L,k=U(t,ro),C=d(()=>R==="horizontal"?"linear-gradient(to right, "+(y?Ar:Cr)+")":"linear-gradient(to bottom, "+(y?Cr:Ar)+")",[R,y]),D=d((S)=>{var B=R==="horizontal"?S.left:S.top;return 360*(R==="horizontal"?y?1-B:B:y?B:1-B)},[R,y]),T=w(()=>C(),[C]);return r(pr,c({ref:e,className:p+" "+(b||"")},k,{direction:R,reverse:y,background:T,hsva:{h:v,s:100,v:100,a:v/360},onChange:(S,B)=>{x&&x({h:D(B)})}}))});Lr.displayName="Hue";var oo=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],to=(t)=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(t),eo=(t)=>Number(String(t).replace(/%/g,"")),tr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input":s,b=t.placement,n=b===void 0?"bottom":b,{label:v,value:x,className:A,style:R,labelStyle:L,inputStyle:y,onChange:k,onBlur:C,renderInput:D}=t,T=U(t,oo),S=o(x),B=S[0],N=S[1],u=i(!1),E=i(T.id||p+"-"+Math.random().toString(36).slice(2,11)),g=T.id||E.current;l(()=>{t.value!==B&&(u.current||N(t.value))},[t.value]);function M(W,z){var F=(z||W.target.value).trim().replace(/^#/,"");to(F)&&k&&k(W,F);var q=eo(F);isNaN(q)||k&&k(W,q),N(F)}function m(W){u.current=!1,N(t.value),C&&C(W)}var h={};n==="bottom"&&(h.flexDirection="column"),n==="top"&&(h.flexDirection="column-reverse"),n==="left"&&(h.flexDirection="row-reverse");var P=c({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},h,R),j=c({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},y),X=c({value:B,onChange:M,onBlur:m,autoComplete:"off",onFocus:()=>u.current=!0},T,{id:g,style:j,onFocusCapture:(W)=>{var z=W.target;z.setSelectionRange(z.value.length,z.value.length)}});return a("div",{className:[p,A||""].filter(Boolean).join(" "),style:P,children:[D?D(X,e):r("input",c({ref:e},X)),v&&r("label",{htmlFor:g,style:c({color:"var(--editable-input-label-color)",textTransform:"capitalize"},L),children:v})]})});tr.displayName="EditableInput";var ao=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],vr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input-rgba":s,{hsva:b,placement:n}=t,v=n===void 0?"bottom":n,x=t.rProps,A=x===void 0?{}:x,R=t.gProps,L=R===void 0?{}:R,y=t.bProps,k=y===void 0?{}:y,C=t.aProps,D=C===void 0?{}:C,{className:T,style:S,onChange:B}=t,N=U(t,ao),u=b?nr(b):{};function E(h){var P=Number(h.target.value);P&&P>255&&(h.target.value="255"),P&&P<0&&(h.target.value="0")}var g=(h)=>{var P=Number(h.target.value);P&&P>100&&(h.target.value="100"),P&&P<0&&(h.target.value="0")},M=(h,P,j)=>{typeof h=="number"&&(P==="a"&&(h<0&&(h=0),h>100&&(h=100),B&&B(_(er(c({},u,{a:h/100}))))),h>255&&(h=255,j.target.value="255"),h<0&&(h=0,j.target.value="0"),P==="r"&&B&&B(_(er(c({},u,{r:h})))),P==="g"&&B&&B(_(er(c({},u,{g:h})))),P==="b"&&B&&B(_(er(c({},u,{b:h})))))},m=u.a?Math.round(u.a*100)/100:0;return a("div",c({ref:e,className:[p,T||""].filter(Boolean).join(" ")},N,{style:c({fontSize:11,display:"flex"},S),children:[r(tr,c({label:"R",value:u.r||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"r",h)},A,{style:c({},A.style)})),r(tr,c({label:"G",value:u.g||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"g",h)},L,{style:c({marginLeft:5},L.style)})),r(tr,c({label:"B",value:u.b||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"b",h)},k,{style:c({marginLeft:5},k.style)})),D&&r(tr,c({label:"A",value:parseInt(String(m*100),10),onBlur:g,placement:v,onChange:(h,P)=>M(P,"a",h)},D,{style:c({marginLeft:5},D.style)}))]}))});vr.displayName="EditableInputRGBA";var no=["prefixCls","hsva","hProps","sProps","lProps","aProps","className","onChange"],Er=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input-hsla":s,{hsva:b,hProps:n}=t,v=n===void 0?{}:n,x=t.sProps,A=x===void 0?{}:x,R=t.lProps,L=R===void 0?{}:R,y=t.aProps,k=y===void 0?{}:y,{className:C,onChange:D}=t,T=U(t,no),S=b?hr(b):{h:0,s:0,l:0,a:0},B=(u,E,g)=>{typeof u=="number"&&(E==="h"&&(u<0&&(u=0),u>360&&(u=360),D&&D(_(sr(c({},S,{h:u}))))),E==="s"&&(u<0&&(u=0),u>100&&(u=100),D&&D(_(sr(c({},S,{s:u}))))),E==="l"&&(u<0&&(u=0),u>100&&(u=100),D&&D(_(sr(c({},S,{l:u}))))),E==="a"&&(u<0&&(u=0),u>1&&(u=1),D&&D(_(sr(c({},S,{a:u}))))))},N=k!=0&&c({label:"A",value:Math.round(S.a*100)/100},k,{onChange:(u,E)=>B(E,"a",u)});return r(vr,c({ref:e,hsva:b,rProps:c({label:"H",value:Math.round(S.h)},v,{onChange:(u,E)=>B(E,"h",u)}),gProps:c({label:"S",value:Math.round(S.s)+"%"},A,{onChange:(u,E)=>B(E,"s",u)}),bProps:c({label:"L",value:Math.round(S.l)+"%"},L,{onChange:(u,E)=>B(E,"l",u)}),aProps:N,className:[p,C||""].filter(Boolean).join(" ")},T))});Er.displayName="EditableInputHSLA";var lo=["style"];function io(t){var e=t.style,s=U(t,lo),p=i(null),b=d(()=>{p.current.style.backgroundColor="var(--chrome-arrow-background-color)"},[]),n=d(()=>{p.current.style.backgroundColor="transparent"},[]);return r("div",c({ref:p,style:c({marginLeft:5,cursor:"pointer",transition:"background-color .3s",borderRadius:2},e)},s,{onMouseEnter:b,onMouseLeave:n,children:r("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",style:{display:"block"},children:r("path",{d:"M373.888 576h276.224c9.322667 0 14.293333 11.178667 9.173333 18.773333l-1.258666 1.557334-138.112 146.858666a10.709333 10.709333 0 0 1-14.293334 1.365334l-1.536-1.365334-138.112-146.858666c-6.592-6.997333-2.666667-18.645333 5.973334-20.16l1.941333-0.170667h276.224-276.224z m146.026667-295.189333l138.112 146.858666c7.04 7.509333 2.069333 20.330667-7.914667 20.330667H373.888c-9.984 0-14.976-12.821333-7.914667-20.330667l138.112-146.858666a10.730667 10.730667 0 0 1 15.829334 0z",fill:"var(--chrome-arrow-fill)"})})}))}function so(){return"EyeDropper"in window}function po(t){return r("svg",{viewBox:"0 0 512 512",height:"1em",width:"1em",onClick:()=>{"EyeDropper"in window&&new window.EyeDropper().open().then((e)=>{t.onPickColor==null||t.onPickColor(e.sRGBHex)}).catch((e)=>{e.name})},children:r("path",{fill:"currentColor",d:"M482.8 29.23c38.9 38.98 38.9 102.17 0 141.17L381.2 271.9l9.4 9.5c12.5 12.5 12.5 32.7 0 45.2s-32.7 12.5-45.2 0l-160-160c-12.5-12.5-12.5-32.7 0-45.2s32.7-12.5 45.2 0l9.5 9.4L341.6 29.23c39-38.974 102.2-38.974 141.2 0zM55.43 323.3 176.1 202.6l45.3 45.3-120.7 120.7c-3.01 3-4.7 7-4.7 11.3V416h36.1c4.3 0 8.3-1.7 11.3-4.7l120.7-120.7 45.3 45.3-120.7 120.7c-15 15-35.4 23.4-56.6 23.4H89.69l-39.94 26.6c-12.69 8.5-29.59 6.8-40.377-4-10.786-10.8-12.459-27.7-3.998-40.4L32 422.3v-42.4c0-21.2 8.43-41.6 23.43-56.6z"})})}var ho=["prefixCls","className","style","color","showEditableInput","showEyeDropper","showColorPreview","showHue","showAlpha","horizontal","inputType","rectProps","onChange"],J=function(t){return t.HEXA="hexa",t.RGBA="rgba",t.HSLA="hsla",t}({}),Dr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-chrome":s,{className:b,style:n,color:v,showEditableInput:x}=t,A=x===void 0||x,R=t.showEyeDropper,L=R===void 0||R,y=t.showColorPreview,k=y===void 0||y,C=t.showHue,D=C===void 0||C,T=t.showAlpha,S=T===void 0||T,B=t.horizontal,N=B!==void 0&&B,u=t.inputType,E=u===void 0?J.RGBA:u;t.rectProps;var g=t.onChange,M=U(t,ho),m=typeof v=="string"&&ur(v)?Z(v):v||{h:0,s:0,l:0,a:0},h=(G)=>g&&g(_(G)),P=o(E),j=P[0],X=P[1],W=()=>{j===J.RGBA&&X(J.HSLA),j===J.HSLA&&X(J.HEXA),j===J.HEXA&&X(J.RGBA)},z={paddingTop:6},F={textAlign:"center",paddingTop:4,paddingBottom:4},q=c({"--chrome-arrow-fill":"#333","--chrome-arrow-background-color":"#e8e8e8",borderRadius:0,flexDirection:N?"row":"column",width:N?460:230,padding:0},n),dr={"--chrome-alpha-box-shadow":"rgb(0 0 0 / 25%) 0px 0px 1px inset",borderRadius:"50%",background:zr(m),boxShadow:"var(--chrome-alpha-box-shadow)"},rr=(G)=>{var K=Z(G);h(c({},K))},lr={height:14,width:14},ir={style:c({},lr),fillProps:{style:lr}};return r(Pr,c({ref:e,color:m,style:q,colors:void 0,className:[p,b].filter(Boolean).join(" "),placement:I.TopLeft},M,{addonAfter:a(de,{children:[r(Nr,{hsva:m,style:N?{width:230,height:120}:{width:"100%",height:130},onChange:(G)=>{h(c({},m,G,{a:m.a}))}}),a("div",{style:{display:"flex",flexDirection:"column",width:N?230:"inherit"},children:[a("div",{style:{padding:15,display:"flex",alignItems:"center",gap:10},children:[so()&&L&&r(po,{onPickColor:rr}),k&&r(pr,{width:28,height:28,hsva:m,radius:2,style:{borderRadius:"50%"},bgProps:{style:{background:"transparent"}},innerProps:{style:dr},pointer:()=>r(de,{})}),a("div",{style:{flex:1},children:[D==1&&r(Lr,{hue:m.h,style:{width:"100%",height:12,borderRadius:2},pointerProps:ir,bgProps:{style:{borderRadius:2}},onChange:(G)=>{h(c({},m,G))}}),S==1&&r(pr,{hsva:m,style:{marginTop:6,height:12,borderRadius:2},pointerProps:ir,bgProps:{style:{borderRadius:2}},onChange:(G)=>{h(c({},m,G))}})]})]}),A&&a("div",{style:{display:"flex",alignItems:"flex-start",padding:"0 15px 15px 15px",userSelect:"none"},children:[a("div",{style:{flex:1},children:[j==J.RGBA&&r(vr,{hsva:m,rProps:{labelStyle:z,inputStyle:F},gProps:{labelStyle:z,inputStyle:F},bProps:{labelStyle:z,inputStyle:F},aProps:S!=0&&{labelStyle:z,inputStyle:F},onChange:(G)=>h(G.hsva)}),j===J.HEXA&&r(tr,{label:"HEX",labelStyle:z,inputStyle:F,value:m.a>0&&m.a<1?jr(m).toLocaleUpperCase():cr(m).toLocaleUpperCase(),onChange:(G,K)=>{typeof K=="string"&&h(Z(/^#/.test(K)?K:"#"+K))}}),j===J.HSLA&&r(Er,{hsva:m,hProps:{labelStyle:z,inputStyle:F},sProps:{labelStyle:z,inputStyle:F},lProps:{labelStyle:z,inputStyle:F},aProps:S!=0&&{labelStyle:z,inputStyle:F},onChange:(G)=>h(G.hsva)})]}),r(io,{onClick:W})]})]})]}),rectRender:()=>r(de,{})}))});Dr.displayName="Chrome";var co="nxgt-color-picker";function bo({color:t,onChange:e}){return r(Dr,{color:t,showTriangle:!1,showAlpha:!1,onChange:(s)=>e(s.hex),className:co})}export{bo as default};
|
|
1
|
+
import{de,ye,f,ie,d,l,w,i,o,r,a}from"./index.e35b4yh5.js";function c(){return c=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var p in s)({}).hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},c.apply(null,arguments)}function U(t,e){if(t==null)return{};var s={};for(var p in t)if({}.hasOwnProperty.call(t,p)){if(e.indexOf(p)!==-1)continue;s[p]=t[p]}return s}var or=255,fr=360,Y=100,er=(t)=>{var{r:e,g:s,b:p,a:b}=t,n=Math.max(e,s,p),v=n-Math.min(e,s,p),x=v?n===e?(s-p)/v:n===s?2+(p-e)/v:4+(e-s)/v:0;return{h:60*(x<0?x+6:x),s:n?v/n*Y:0,v:n/or*Y,a:b}},Rr=(t)=>{var e=hr(t),{h:s,s:p,l:b,a:n}=e;return"hsla("+s+", "+p+"%, "+b+"%, "+n+")"},sr=(t)=>{var{h:e,s,l:p,a:b}=t;return s*=(p<50?p:Y-p)/Y,{h:e,s:s>0?2*s/(p+s)*Y:0,v:p+s,a:b}},hr=(t)=>{var{h:e,s,v:p,a:b}=t,n=(200-s)*p/Y;return{h:e,s:n>0&&n<200?s*p/Y/(n<=Y?n:200-n)*Y:0,l:n/2,a:b}};fr/400,fr/(Math.PI*2);var Br=(t)=>{var{r:e,g:s,b:p}=t;return"#"+((b)=>Array(7-b.length).join("0")+b)((e<<16|s<<8|p).toString(16))},kr=(t)=>{var{r:e,g:s,b:p,a:b}=t,n=typeof b=="number"&&(b*255|256).toString(16).slice(1);return""+Br({r:e,g:s,b:p})+(n||"")},Z=(t)=>er(Mr(t)),Mr=(t)=>{var e=t.replace("#","");/^#?/.test(t)&&e.length===3&&(t="#"+e.charAt(0)+e.charAt(0)+e.charAt(1)+e.charAt(1)+e.charAt(2)+e.charAt(2));var s=RegExp("[A-Za-z0-9]{2}","g"),p=t.match(s).map((x)=>parseInt(x,16)),b=p[0],n=p[1],v=p[2];return{r:b,g:n,b:v===void 0?0:v,a:(p[3]??255)/or}},nr=(t)=>{var{h:e,s,v:p,a:b}=t,n=e/60,v=s/Y,x=p/Y,A=Math.floor(n)%6;A<0&&(A+=6);var R=n-Math.floor(n),L=or*x*(1-v),y=or*x*(1-v*R),k=or*x*(1-v*(1-R));x*=or;var C={};switch(A){case 0:C.r=x,C.g=k,C.b=L;break;case 1:C.r=y,C.g=x,C.b=L;break;case 2:C.r=L,C.g=x,C.b=k;break;case 3:C.r=L,C.g=y,C.b=x;break;case 4:C.r=k,C.g=L,C.b=x;break;case 5:C.r=x,C.g=L,C.b=y}return C.r=Math.round(C.r),C.g=Math.round(C.g),C.b=Math.round(C.b),c({},C,{a:b})},zr=(t)=>{var e=nr(t),{r:s,g:p,b,a:n}=e;return"rgba("+s+", "+p+", "+b+", "+n+")"},Ir=(t)=>({r:t.r,g:t.g,b:t.b}),Hr=(t)=>({h:t.h,s:t.s,l:t.l}),cr=(t)=>Br(nr(t)),jr=(t)=>kr(nr(t)),Fr=(t)=>({h:t.h,s:t.s,v:t.v}),Gr=(t)=>{var{r:e,g:s,b:p}=t,b=function(R){return R<=0.04045?R/12.92:((R+0.055)/1.055)**2.4},n=b(e/255),v=b(s/255),x=b(p/255),A={};return A.x=n*0.4124+v*0.3576+x*0.1805,A.y=n*0.2126+v*0.7152+x*0.0722,A.bri=n*0.0193+v*0.1192+x*0.9505,A},_=(t)=>{var e,s,p,b,n,v,x,A,R;return typeof t=="string"&&ur(t)?(v=Z(t),A=t):typeof t!="string"&&(v=t),v&&(p=Fr(v),n=hr(v),b=nr(v),R=kr(b),A=cr(v),s=Hr(n),e=Ir(b),x=Gr(e)),{rgb:e,hsl:s,hsv:p,rgba:b,hsla:n,hsva:v,hex:A,hexa:R,xy:x}},ur=(t)=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(t);function Or(t){if(t==null)throw TypeError("Cannot destructure "+t)}var Wr=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],Sr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-swatch":s,{className:b,color:n,colors:v}=t,x=v===void 0?[]:v,{style:A,rectProps:R}=t,L=R===void 0?{}:R,{onChange:y,addonAfter:k,addonBefore:C,rectRender:D}=t,T=U(t,Wr),S=c({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},L.style),B=(N,u)=>{y&&y(Z(N),_(Z(N)),u)};return a("div",c({ref:e},T,{className:[p,b||""].filter(Boolean).join(" "),style:c({display:"flex",flexWrap:"wrap",position:"relative"},A),children:[C&&ie(C)&&C,x&&Array.isArray(x)&&x.map((N,u)=>{var E="",g="";typeof N=="string"&&(E=N,g=N),typeof N=="object"&&N.color&&(E=N.title||N.color,g=N.color);var M=n&&n.toLocaleLowerCase()===g.toLocaleLowerCase(),m=D&&D({title:E,color:g,checked:!!M,style:c({},S,{background:g}),onClick:(P)=>B(g,P)});if(m)return r(de,{children:m},u);var h=L.children&&ie(L.children)?ye(L.children,{color:g,checked:M}):null;return r("div",c({tabIndex:0,title:E,onClick:(P)=>B(g,P)},L,{children:h,style:c({},S,{background:g})}),u)}),k&&ie(k)&&k]}))});Sr.displayName="Swatch";var Ur={marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25};function Xr(t){var{style:e,title:s,checked:p}=t;t.color;var{onClick:b,rectProps:n}=t,v=i(null),x=d(()=>{v.current.style.zIndex="2",v.current.style.outline="#fff solid 2px",v.current.style.boxShadow="rgb(0 0 0 / 25%) 0 0 5px 2px"},[]),A=d(()=>{p||(v.current.style.zIndex="0",v.current.style.outline="initial",v.current.style.boxShadow="initial")},[p]);return r("div",c({ref:v,title:s},n,{onClick:b,onMouseEnter:x,onMouseLeave:A,style:c({},e,{marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25},Ur,p?{zIndex:1,outline:"#fff solid 2px",boxShadow:"rgb(0 0 0 / 25%) 0 0 5px 2px"}:{zIndex:0},n?.style)}))}var Yr=["prefixCls","placement","className","style","color","colors","showTriangle","rectProps","onChange","rectRender"],_r=["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],I=function(t){return t.Left="L",t.LeftTop="LT",t.LeftBottom="LB",t.Right="R",t.RightTop="RT",t.RightBottom="RB",t.Top="T",t.TopRight="TR",t.TopLeft="TL",t.Bottom="B",t.BottomLeft="BL",t.BottomRight="BR",t}({}),Pr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-github":s,b=t.placement,n=b===void 0?I.TopRight:b,{className:v,style:x,color:A,colors:R}=t,L=R===void 0?_r:R,y=t.showTriangle,k=y===void 0||y,C=t.rectProps,D=C===void 0?{}:C,{onChange:T,rectRender:S}=t,B=U(t,Yr),N=typeof A=="string"&&ur(A)?Z(A):A,u=A?cr(N):"",E=(P)=>T&&T(_(P)),g=c({"--github-border":"1px solid rgba(0, 0, 0, 0.2)","--github-background-color":"#fff","--github-box-shadow":"rgb(0 0 0 / 15%) 0px 3px 12px","--github-arrow-border-color":"rgba(0, 0, 0, 0.15)",width:200,borderRadius:4,background:"var(--github-background-color)",boxShadow:"var(--github-box-shadow)",border:"var(--github-border)",position:"relative",padding:5},x),M={borderStyle:"solid",position:"absolute"},m=c({},M),h=c({},M);return/^T/.test(n)&&(m.borderWidth="0 8px 8px",m.borderColor="transparent transparent var(--github-arrow-border-color)",h.borderWidth="0 7px 7px",h.borderColor="transparent transparent var(--github-background-color)"),n===I.TopRight&&(m.top=-8,h.top=-7),n===I.Top&&(m.top=-8,h.top=-7),n===I.TopLeft&&(m.top=-8,h.top=-7),/^B/.test(n)&&(m.borderWidth="8px 8px 0",m.borderColor="var(--github-arrow-border-color) transparent transparent",h.borderWidth="7px 7px 0",h.borderColor="var(--github-background-color) transparent transparent",n===I.BottomRight&&(m.top="100%",h.top="100%"),n===I.Bottom&&(m.top="100%",h.top="100%"),n===I.BottomLeft&&(m.top="100%",h.top="100%")),/^(B|T)/.test(n)&&((n===I.Top||n===I.Bottom)&&(m.left="50%",m.marginLeft=-8,h.left="50%",h.marginLeft=-7),(n===I.TopRight||n===I.BottomRight)&&(m.right=10,h.right=11),(n===I.TopLeft||n===I.BottomLeft)&&(m.left=7,h.left=8)),/^L/.test(n)&&(m.borderWidth="8px 8px 8px 0",m.borderColor="transparent var(--github-arrow-border-color) transparent transparent",h.borderWidth="7px 7px 7px 0",h.borderColor="transparent var(--github-background-color) transparent transparent",m.left=-8,h.left=-7),/^R/.test(n)&&(m.borderWidth="8px 0 8px 8px",m.borderColor="transparent transparent transparent var(--github-arrow-border-color)",h.borderWidth="7px 0 7px 7px",h.borderColor="transparent transparent transparent var(--github-background-color)",m.right=-8,h.right=-7),/^(L|R)/.test(n)&&((n===I.RightTop||n===I.LeftTop)&&(m.top=5,h.top=6),(n===I.Left||n===I.Right)&&(m.top="50%",h.top="50%",m.marginTop=-8,h.marginTop=-7),(n===I.LeftBottom||n===I.RightBottom)&&(m.top="100%",h.top="100%",m.marginTop=-21,h.marginTop=-20)),r(Sr,c({ref:e,className:[p,v].filter(Boolean).join(" "),colors:L,color:u,rectRender:(P)=>{var j=c({},(Or(P),P));return S&&S(c({},j))||r(Xr,c({},j,{rectProps:D}))}},B,{onChange:E,style:g,rectProps:{style:{marginRight:0,marginBottom:0,borderRadius:0,height:25,width:25}},addonBefore:r(de,{children:k&&a(de,{children:[r("div",{style:m}),r("div",{style:h})]})})}))});Pr.displayName="Github";function mr(t){var e=i(t);return l(()=>{e.current=t}),d((s,p)=>e.current&&e.current(s,p),[])}var ar=(t)=>("touches"in t),xr=(t)=>{!ar(t)&&t.preventDefault&&t.preventDefault()},yr=function(t,e,s){return e===void 0&&(e=0),s===void 0&&(s=1),t>s?s:t<e?e:t},wr=(t,e)=>{var s=t.getBoundingClientRect(),p=ar(e)?e.touches[0]:e;return{left:yr((p.pageX-(s.left+window.pageXOffset))/s.width),top:yr((p.pageY-(s.top+window.pageYOffset))/s.height),width:s.width,height:s.height,x:p.pageX-(s.left+window.pageXOffset),y:p.pageY-(s.top+window.pageYOffset)}},Vr=["prefixCls","className","onMove","onDown"],gr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-interactive":s,{className:b,onMove:n,onDown:v}=t,x=U(t,Vr),A=i(null),R=i(!1),L=o(!1),y=L[0],k=L[1],C=mr(n),D=mr(v),T=(g)=>R.current&&!ar(g)?!1:(R.current=ar(g),!0),S=d((g)=>{xr(g),A.current&&((ar(g)?g.touches.length>0:g.buttons>0)?C?.(wr(A.current,g),g):k(!1))},[C]),B=d(()=>k(!1),[]),N=d((g)=>{g?(window.addEventListener(R.current?"touchmove":"mousemove",S),window.addEventListener(R.current?"touchend":"mouseup",B)):(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",B),window.removeEventListener("touchmove",S),window.removeEventListener("touchend",B))},[S,B]);l(()=>(N(y),()=>{N(!1)}),[y,S,B,N]);var u=d((g)=>{document.activeElement?.blur(),xr(g.nativeEvent),T(g.nativeEvent)&&A.current&&(D?.(wr(A.current,g.nativeEvent),g.nativeEvent),k(!0))},[D]),E=d((g)=>{A.current=g,typeof e=="function"?e(g):e&&(e.current=g)},[e]);return r("div",c({},x,{className:[p,b||""].filter(Boolean).join(" "),style:c({},x.style,{touchAction:"none"}),ref:E,tabIndex:0,onMouseDown:u,onTouchStart:u}))});gr.displayName="Interactive";var Jr=(t)=>{var{className:e,color:s,left:p,top:b,prefixCls:n}=t,v={position:"absolute",top:b,left:p},x={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:s};return w(()=>r("div",{className:n+"-pointer "+(e||""),style:v,children:r("div",{className:n+"-fill",style:x})}),[b,p,s,e,n])},Kr=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],Nr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-saturation":s,b=t.radius,n=b===void 0?0:b,{pointer:v,className:x,hue:A}=t,R=A===void 0?0:A,{style:L,hsva:y,onChange:k}=t,C=U(t,Kr),D=c({width:200,height:200,borderRadius:n},L,{position:"relative"}),T=i(null),S=d((g)=>{T.current=g,typeof e=="function"?e(g):e&&("current"in e)&&(e.current=g)},[e]),B=d((g,M)=>{k&&y&&k({h:y.h,s:g.left*100,v:(1-g.top)*100,a:y.a});var m=T.current;m&&m.focus()},[y,k]),N=d((g)=>{if(y&&k){var M=1,{s:m,v:h}=y;switch(g.key){case"ArrowLeft":m=Math.max(0,y.s-M),g.preventDefault();break;case"ArrowRight":m=Math.min(100,y.s+M),g.preventDefault();break;case"ArrowUp":h=Math.min(100,y.v+M),g.preventDefault();break;case"ArrowDown":h=Math.max(0,y.v-M),g.preventDefault();break;default:return}k({h:y.h,s:m,v:h,a:y.a})}},[y,k]),u=w(()=>{if(!y)return null;var g={top:100-y.v+"%",left:y.s+"%",color:Rr(y)};return v&&typeof v=="function"?v(c({prefixCls:p},g)):r(Jr,c({prefixCls:p},g))},[y,v,p]),E=d((g)=>{g.target.focus()},[]);return r(gr,c({className:[p,x||""].filter(Boolean).join(" ")},C,{style:c({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(y?.h??R)+", 100%, 50%))"},D,{outline:"none"}),ref:S,onMove:B,onDown:B,onKeyDown:N,onClick:E,children:u}))});Nr.displayName="Saturation";var Qr=["className","prefixCls","left","top","style","fillProps"],Zr=(t)=>{var{className:e,prefixCls:s,left:p,top:b,style:n,fillProps:v}=t,x=U(t,Qr),A=c({},n,{position:"absolute",left:p,top:b}),R=c({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},v?.style,{transform:p?"translate(-9px, -1px)":"translate(-1px, -9px)"});return r("div",c({className:s+"-pointer "+(e||""),style:A},x,{children:r("div",c({className:s+"-fill"},v,{style:R}))}))},$r=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","reverse","style","onChange","pointer"],qr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",pr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-alpha":s,{className:b,hsva:n,background:v,bgProps:x}=t,A=x===void 0?{}:x,R=t.innerProps,L=R===void 0?{}:R,y=t.pointerProps,k=y===void 0?{}:y,C=t.radius,D=C===void 0?0:C,{width:T,height:S}=t,B=S===void 0?16:S,N=t.direction,u=N===void 0?"horizontal":N,E=t.reverse,g=E!==void 0&&E,{style:M,onChange:m,pointer:h}=t,P=U(t,$r),j=d((H)=>{var O=u==="horizontal"?H.left:H.top;return u==="horizontal"?g?1-O:O:g?O:1-O},[u,g]),X=d((H)=>u==="horizontal"?g?1-H:H:g?H:1-H,[u,g]),W=(H)=>{var O=j(H);m&&m(c({},n,{a:O}),H)},z=Rr(Object.assign({},n,{a:1})),F=g?"linear-gradient(to right, "+z+" 0%, rgba(244, 67, 54, 0) 100%)":"linear-gradient(to right, rgba(244, 67, 54, 0) 0%, "+z+" 100%)",q=g?"linear-gradient(to bottom, rgba(244, 67, 54, 0) 0%, "+z+" 100%)":"linear-gradient(to bottom, "+z+" 0%, rgba(244, 67, 54, 0) 100%)",dr=u==="horizontal"?F:q,rr={};u==="horizontal"?rr.left=X(n.a)*100+"%":rr.top=X(n.a)*100+"%";var lr=c({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:D,background:"url("+qr+") left center",backgroundColor:"var(--alpha-background-color)"},{width:T,height:B},M,{position:"relative"}),ir=d((H)=>{var O=0.01,V=n.a,Q=V;switch(H.key){case"ArrowLeft":u==="horizontal"&&(Q=g?Math.min(1,V+O):Math.max(0,V-O),H.preventDefault());break;case"ArrowRight":u==="horizontal"&&(Q=g?Math.max(0,V-O):Math.min(1,V+O),H.preventDefault());break;case"ArrowUp":u==="vertical"&&(Q=g?Math.max(0,V-O):Math.min(1,V+O),H.preventDefault());break;case"ArrowDown":u==="vertical"&&(Q=g?Math.min(1,V+O):Math.max(0,V-O),H.preventDefault());break;default:return}if(Q!==V){var br=X(Q),Tr={left:u==="horizontal"?br:n.a,top:u==="vertical"?br:n.a,width:0,height:0,x:0,y:0};m&&m(c({},n,{a:Q}),Tr)}},[X,n,u,m,g]),G=d((H)=>{H.target.focus()},[]),K=h&&typeof h=="function"?h(c({prefixCls:p},k,rr)):r(Zr,c({},k,{prefixCls:p},rr));return a("div",c({},P,{className:[p,p+"-"+u,b||""].filter(Boolean).join(" "),style:lr,ref:e,children:[r("div",c({},A,{style:c({inset:0,position:"absolute",background:v||dr,borderRadius:D},A.style)})),r(gr,c({},L,{style:c({},L.style,{inset:0,zIndex:1,position:"absolute",outline:"none"}),onMove:W,onDown:W,onClick:G,onKeyDown:ir,children:K}))]}))});pr.displayName="Alpha";var ro=["prefixCls","className","hue","onChange","direction","reverse"],Cr="rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%",Ar="rgb(255, 0, 0) 0%, rgb(255, 0, 255) 17%, rgb(0, 0, 255) 33%, rgb(0, 255, 255) 50%, rgb(0, 255, 0) 67%, rgb(255, 255, 0) 83%, rgb(255, 0, 0) 100%",Lr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-hue":s,{className:b,hue:n}=t,v=n===void 0?0:n,{onChange:x,direction:A}=t,R=A===void 0?"horizontal":A,L=t.reverse,y=L!==void 0&&L,k=U(t,ro),C=d(()=>R==="horizontal"?"linear-gradient(to right, "+(y?Ar:Cr)+")":"linear-gradient(to bottom, "+(y?Cr:Ar)+")",[R,y]),D=d((S)=>{var B=R==="horizontal"?S.left:S.top;return 360*(R==="horizontal"?y?1-B:B:y?B:1-B)},[R,y]),T=w(()=>C(),[C]);return r(pr,c({ref:e,className:p+" "+(b||"")},k,{direction:R,reverse:y,background:T,hsva:{h:v,s:100,v:100,a:v/360},onChange:(S,B)=>{x&&x({h:D(B)})}}))});Lr.displayName="Hue";var oo=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur","renderInput"],to=(t)=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(t),eo=(t)=>Number(String(t).replace(/%/g,"")),tr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input":s,b=t.placement,n=b===void 0?"bottom":b,{label:v,value:x,className:A,style:R,labelStyle:L,inputStyle:y,onChange:k,onBlur:C,renderInput:D}=t,T=U(t,oo),S=o(x),B=S[0],N=S[1],u=i(!1),E=i(T.id||p+"-"+Math.random().toString(36).slice(2,11)),g=T.id||E.current;l(()=>{t.value!==B&&(u.current||N(t.value))},[t.value]);function M(W,z){var F=(z||W.target.value).trim().replace(/^#/,"");to(F)&&k&&k(W,F);var q=eo(F);isNaN(q)||k&&k(W,q),N(F)}function m(W){u.current=!1,N(t.value),C&&C(W)}var h={};n==="bottom"&&(h.flexDirection="column"),n==="top"&&(h.flexDirection="column-reverse"),n==="left"&&(h.flexDirection="row-reverse");var P=c({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},h,R),j=c({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},y),X=c({value:B,onChange:M,onBlur:m,autoComplete:"off",onFocus:()=>u.current=!0},T,{id:g,style:j,onFocusCapture:(W)=>{var z=W.target;z.setSelectionRange(z.value.length,z.value.length)}});return a("div",{className:[p,A||""].filter(Boolean).join(" "),style:P,children:[D?D(X,e):r("input",c({ref:e},X)),v&&r("label",{htmlFor:g,style:c({color:"var(--editable-input-label-color)",textTransform:"capitalize"},L),children:v})]})});tr.displayName="EditableInput";var ao=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],vr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input-rgba":s,{hsva:b,placement:n}=t,v=n===void 0?"bottom":n,x=t.rProps,A=x===void 0?{}:x,R=t.gProps,L=R===void 0?{}:R,y=t.bProps,k=y===void 0?{}:y,C=t.aProps,D=C===void 0?{}:C,{className:T,style:S,onChange:B}=t,N=U(t,ao),u=b?nr(b):{};function E(h){var P=Number(h.target.value);P&&P>255&&(h.target.value="255"),P&&P<0&&(h.target.value="0")}var g=(h)=>{var P=Number(h.target.value);P&&P>100&&(h.target.value="100"),P&&P<0&&(h.target.value="0")},M=(h,P,j)=>{typeof h=="number"&&(P==="a"&&(h<0&&(h=0),h>100&&(h=100),B&&B(_(er(c({},u,{a:h/100}))))),h>255&&(h=255,j.target.value="255"),h<0&&(h=0,j.target.value="0"),P==="r"&&B&&B(_(er(c({},u,{r:h})))),P==="g"&&B&&B(_(er(c({},u,{g:h})))),P==="b"&&B&&B(_(er(c({},u,{b:h})))))},m=u.a?Math.round(u.a*100)/100:0;return a("div",c({ref:e,className:[p,T||""].filter(Boolean).join(" ")},N,{style:c({fontSize:11,display:"flex"},S),children:[r(tr,c({label:"R",value:u.r||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"r",h)},A,{style:c({},A.style)})),r(tr,c({label:"G",value:u.g||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"g",h)},L,{style:c({marginLeft:5},L.style)})),r(tr,c({label:"B",value:u.b||0,onBlur:E,placement:v,onChange:(h,P)=>M(P,"b",h)},k,{style:c({marginLeft:5},k.style)})),D&&r(tr,c({label:"A",value:parseInt(String(m*100),10),onBlur:g,placement:v,onChange:(h,P)=>M(P,"a",h)},D,{style:c({marginLeft:5},D.style)}))]}))});vr.displayName="EditableInputRGBA";var no=["prefixCls","hsva","hProps","sProps","lProps","aProps","className","onChange"],Er=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-editable-input-hsla":s,{hsva:b,hProps:n}=t,v=n===void 0?{}:n,x=t.sProps,A=x===void 0?{}:x,R=t.lProps,L=R===void 0?{}:R,y=t.aProps,k=y===void 0?{}:y,{className:C,onChange:D}=t,T=U(t,no),S=b?hr(b):{h:0,s:0,l:0,a:0},B=(u,E,g)=>{typeof u=="number"&&(E==="h"&&(u<0&&(u=0),u>360&&(u=360),D&&D(_(sr(c({},S,{h:u}))))),E==="s"&&(u<0&&(u=0),u>100&&(u=100),D&&D(_(sr(c({},S,{s:u}))))),E==="l"&&(u<0&&(u=0),u>100&&(u=100),D&&D(_(sr(c({},S,{l:u}))))),E==="a"&&(u<0&&(u=0),u>1&&(u=1),D&&D(_(sr(c({},S,{a:u}))))))},N=k!=0&&c({label:"A",value:Math.round(S.a*100)/100},k,{onChange:(u,E)=>B(E,"a",u)});return r(vr,c({ref:e,hsva:b,rProps:c({label:"H",value:Math.round(S.h)},v,{onChange:(u,E)=>B(E,"h",u)}),gProps:c({label:"S",value:Math.round(S.s)+"%"},A,{onChange:(u,E)=>B(E,"s",u)}),bProps:c({label:"L",value:Math.round(S.l)+"%"},L,{onChange:(u,E)=>B(E,"l",u)}),aProps:N,className:[p,C||""].filter(Boolean).join(" ")},T))});Er.displayName="EditableInputHSLA";var lo=["style"];function io(t){var e=t.style,s=U(t,lo),p=i(null),b=d(()=>{p.current.style.backgroundColor="var(--chrome-arrow-background-color)"},[]),n=d(()=>{p.current.style.backgroundColor="transparent"},[]);return r("div",c({ref:p,style:c({marginLeft:5,cursor:"pointer",transition:"background-color .3s",borderRadius:2},e)},s,{onMouseEnter:b,onMouseLeave:n,children:r("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",style:{display:"block"},children:r("path",{d:"M373.888 576h276.224c9.322667 0 14.293333 11.178667 9.173333 18.773333l-1.258666 1.557334-138.112 146.858666a10.709333 10.709333 0 0 1-14.293334 1.365334l-1.536-1.365334-138.112-146.858666c-6.592-6.997333-2.666667-18.645333 5.973334-20.16l1.941333-0.170667h276.224-276.224z m146.026667-295.189333l138.112 146.858666c7.04 7.509333 2.069333 20.330667-7.914667 20.330667H373.888c-9.984 0-14.976-12.821333-7.914667-20.330667l138.112-146.858666a10.730667 10.730667 0 0 1 15.829334 0z",fill:"var(--chrome-arrow-fill)"})})}))}function so(){return"EyeDropper"in window}function po(t){return r("svg",{viewBox:"0 0 512 512",height:"1em",width:"1em",onClick:()=>{"EyeDropper"in window&&new window.EyeDropper().open().then((e)=>{t.onPickColor==null||t.onPickColor(e.sRGBHex)}).catch((e)=>{e.name})},children:r("path",{fill:"currentColor",d:"M482.8 29.23c38.9 38.98 38.9 102.17 0 141.17L381.2 271.9l9.4 9.5c12.5 12.5 12.5 32.7 0 45.2s-32.7 12.5-45.2 0l-160-160c-12.5-12.5-12.5-32.7 0-45.2s32.7-12.5 45.2 0l9.5 9.4L341.6 29.23c39-38.974 102.2-38.974 141.2 0zM55.43 323.3 176.1 202.6l45.3 45.3-120.7 120.7c-3.01 3-4.7 7-4.7 11.3V416h36.1c4.3 0 8.3-1.7 11.3-4.7l120.7-120.7 45.3 45.3-120.7 120.7c-15 15-35.4 23.4-56.6 23.4H89.69l-39.94 26.6c-12.69 8.5-29.59 6.8-40.377-4-10.786-10.8-12.459-27.7-3.998-40.4L32 422.3v-42.4c0-21.2 8.43-41.6 23.43-56.6z"})})}var ho=["prefixCls","className","style","color","showEditableInput","showEyeDropper","showColorPreview","showHue","showAlpha","horizontal","inputType","rectProps","onChange"],J=function(t){return t.HEXA="hexa",t.RGBA="rgba",t.HSLA="hsla",t}({}),Dr=f((t,e)=>{var s=t.prefixCls,p=s===void 0?"w-color-chrome":s,{className:b,style:n,color:v,showEditableInput:x}=t,A=x===void 0||x,R=t.showEyeDropper,L=R===void 0||R,y=t.showColorPreview,k=y===void 0||y,C=t.showHue,D=C===void 0||C,T=t.showAlpha,S=T===void 0||T,B=t.horizontal,N=B!==void 0&&B,u=t.inputType,E=u===void 0?J.RGBA:u;t.rectProps;var g=t.onChange,M=U(t,ho),m=typeof v=="string"&&ur(v)?Z(v):v||{h:0,s:0,l:0,a:0},h=(G)=>g&&g(_(G)),P=o(E),j=P[0],X=P[1],W=()=>{j===J.RGBA&&X(J.HSLA),j===J.HSLA&&X(J.HEXA),j===J.HEXA&&X(J.RGBA)},z={paddingTop:6},F={textAlign:"center",paddingTop:4,paddingBottom:4},q=c({"--chrome-arrow-fill":"#333","--chrome-arrow-background-color":"#e8e8e8",borderRadius:0,flexDirection:N?"row":"column",width:N?460:230,padding:0},n),dr={"--chrome-alpha-box-shadow":"rgb(0 0 0 / 25%) 0px 0px 1px inset",borderRadius:"50%",background:zr(m),boxShadow:"var(--chrome-alpha-box-shadow)"},rr=(G)=>{var K=Z(G);h(c({},K))},lr={height:14,width:14},ir={style:c({},lr),fillProps:{style:lr}};return r(Pr,c({ref:e,color:m,style:q,colors:void 0,className:[p,b].filter(Boolean).join(" "),placement:I.TopLeft},M,{addonAfter:a(de,{children:[r(Nr,{hsva:m,style:N?{width:230,height:120}:{width:"100%",height:130},onChange:(G)=>{h(c({},m,G,{a:m.a}))}}),a("div",{style:{display:"flex",flexDirection:"column",width:N?230:"inherit"},children:[a("div",{style:{padding:15,display:"flex",alignItems:"center",gap:10},children:[so()&&L&&r(po,{onPickColor:rr}),k&&r(pr,{width:28,height:28,hsva:m,radius:2,style:{borderRadius:"50%"},bgProps:{style:{background:"transparent"}},innerProps:{style:dr},pointer:()=>r(de,{})}),a("div",{style:{flex:1},children:[D==1&&r(Lr,{hue:m.h,style:{width:"100%",height:12,borderRadius:2},pointerProps:ir,bgProps:{style:{borderRadius:2}},onChange:(G)=>{h(c({},m,G))}}),S==1&&r(pr,{hsva:m,style:{marginTop:6,height:12,borderRadius:2},pointerProps:ir,bgProps:{style:{borderRadius:2}},onChange:(G)=>{h(c({},m,G))}})]})]}),A&&a("div",{style:{display:"flex",alignItems:"flex-start",padding:"0 15px 15px 15px",userSelect:"none"},children:[a("div",{style:{flex:1},children:[j==J.RGBA&&r(vr,{hsva:m,rProps:{labelStyle:z,inputStyle:F},gProps:{labelStyle:z,inputStyle:F},bProps:{labelStyle:z,inputStyle:F},aProps:S!=0&&{labelStyle:z,inputStyle:F},onChange:(G)=>h(G.hsva)}),j===J.HEXA&&r(tr,{label:"HEX",labelStyle:z,inputStyle:F,value:m.a>0&&m.a<1?jr(m).toLocaleUpperCase():cr(m).toLocaleUpperCase(),onChange:(G,K)=>{typeof K=="string"&&h(Z(/^#/.test(K)?K:"#"+K))}}),j===J.HSLA&&r(Er,{hsva:m,hProps:{labelStyle:z,inputStyle:F},sProps:{labelStyle:z,inputStyle:F},lProps:{labelStyle:z,inputStyle:F},aProps:S!=0&&{labelStyle:z,inputStyle:F},onChange:(G)=>h(G.hsva)})]}),r(io,{onClick:W})]})]})]}),rectRender:()=>r(de,{})}))});Dr.displayName="Chrome";var co="nxgt-color-picker";function bo({color:t,onChange:e}){return r(Dr,{color:t,showTriangle:!1,showAlpha:!1,onChange:(s)=>e(s.hex),className:co})}export{bo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_,me,qe,l,i,r,a,v,Se,xi,Sn,En,An,Tr,Cr,rn,Go}from"./index.
|
|
1
|
+
import{_,me,qe,l,i,r,a,v,Se,xi,Sn,En,An,Tr,Cr,rn,Go}from"./index.e35b4yh5.js";import{wa}from"./index.1d7qpsyx.js";var k=qe(()=>(_("0ds56d6x"),import("./markup-color-chrome-ykGNUl8y.0ds56d6x.js")));function j(c){let{anchor:o,open:t,onOpenChange:u,current:f,onPick:h}=c,{t:g}=v(),C=Go(),n=i(null),p=Se(c.onDone),s=i(!1);l(()=>{!t&&n.current&&(p.current(n.current),n.current=null)},[t,p]);let d=r(me,{fallback:r("div",{"aria-busy":"true",className:"h-56 w-56"}),children:r(k,{color:wa(f),onChange:(e)=>{n.current=e,h(e)}})}),m=g("material.image-editor.markup.color-picker","Pick a colour");return C?r(En,{open:t,onOpenChange:u,children:a(An,{side:"bottom","data-slot":"image-editor-color-sheet",children:[r(xi,{children:r(Sn,{children:m})}),r("div",{className:"flex justify-center px-4 pb-6",children:d})]})}):a(Tr,{open:t,onOpenChange:u,children:[r(rn,{virtualRef:o}),r(Cr,{className:"w-auto p-0",side:"top",align:"start",collisionBoundary:o.current?.closest('[data-slot="image-editor"]'),"aria-label":m,onOpenAutoFocus:void 0,onInteractOutside:(e)=>{o.current?.contains(e.target)?e.preventDefault():s.current=!0},onCloseAutoFocus:(e)=>{e.preventDefault(),s.current||o.current?.focus(),s.current=!1},children:d})]})}export{j as MarkupCustomColor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{de,ye,E,ie,P,H,T,r,a,s,v,ne,ft,No,_n,le,Fl,ga,ki,zo,Ti}from"./index.5vcex75v.js";import{Ll}from"./index.3k4gyba0.js";function he(e){return typeof e=="string"?Ll(e).map((t,i,n)=>a(de,{children:[t.split(/(-+.?)/).map((l,c)=>l.startsWith("-")?r("span",{className:"whitespace-nowrap",children:l},c):l),i<n.length-1&&r("wbr",{})]},i)):e}var xe=E(void 0);function ge(e){let t=P(xe);return e??t}function ve({children:e,className:t,...i}){let n=!!(i["aria-label"]||i["aria-labelledby"]);return r(ne,{"data-slot":"icon-badge","aria-hidden":n?void 0:"true",role:n?"img":void 0,...i,asChild:!0,className:s("cursor-default",t),children:r("span",{children:e})})}var be={sm:"size-10 rounded-xl text-xl [&_svg:not([class*='size-'])]:size-5 [--nxgt-icon-size:1.25rem]",md:"size-12 rounded-2xl text-2xl [&_svg:not([class*='size-'])]:size-6 [--nxgt-icon-size:1.5rem]",lg:"size-14 rounded-2xl text-3xl [&_svg:not([class*='size-'])]:size-7 [--nxgt-icon-size:1.75rem]"};function K({children:e,size:t="md",variant:i="tonal",color:n="primary",className:l,...c}){return r(ve,{...c,"data-slot":"icon-tile",variant:i,color:n,className:s("shrink-0",be[t],l),children:e})}K.displayName="IconTile";function we({accent:e,leading:t}){if(e==null)return r(T,{children:t});if(!le(t))return r("span",{className:"flex h-6 shrink-0 items-center",children:r("span",{"aria-hidden":!0,"data-slot":"item-accent","data-tone":e,className:"size-2 rounded-full bg-tone-text"})});if(ie(t)&&t.type===Ti)return ye(t,{tone:t.props.tone??e});let i=ie(t)&&t.type===K,n=i?{sm:"size-10 [--nxgt-icon-size:1.25rem]",md:"size-12 [--nxgt-icon-size:1.5rem]",lg:"size-14 [--nxgt-icon-size:1.75rem]"}[t.props.size??"md"]:"size-9";return r("span",{"data-slot":"item-accent","data-tone":e,className:`inline-flex ${n} shrink-0 items-center justify-center rounded-full bg-tone-container text-tone-text shadow-[inset_0_0_0_1px_var(--nxgt-tone-ring)] [&_svg:not([class*='size-'])]:size-[var(--nxgt-icon-size,1rem)]`,children:i?t.props.children:t})}var M="[&>*]:max-w-full [&>*]:min-w-0 [&>*]:justify-start [&>*]:overflow-hidden [&>*]:text-ellipsis [&>*]:whitespace-nowrap";function Ne({children:e,align:t,selfStart:i}){return t?r("span",{"data-slot":"item-leading",className:s("flex w-(--nxgt-leading-width,5rem) min-w-0 shrink-0 items-center overflow-hidden",M,i&&"self-start"),children:e}):i&&le(e)?r("span",{className:"self-start",children:e}):r(T,{children:e})}function ke({children:e,align:t}){return t?r("span",{"data-slot":"item-trailing",className:s("flex w-(--nxgt-trailing-width,6rem) min-w-0 shrink-0 items-center justify-end overflow-hidden text-end",M),children:e}):r(T,{children:e})}function j({subtitle:e,selected:t,note:i,id:n}){return le(e)?r(ft,{as:"span",variant:i?"body-sm":void 0,id:n,className:s("wrap-anywhere",t?"text-foreground/70":"text-muted-foreground"),children:e}):null}var U=({children:e})=>le(e)?r("span",{className:"text-sm text-muted-foreground",children:e}):null;function ze(e){return e.stacked?r(Ce,{...e}):r(Ae,{...e})}function Ce({title:e,subtitle:t,chips:i,secondary:n,status:l,statusPlacement:c,selected:d,xs:o,subtitleId:u}){let m=c==="name"&&le(l);return a("div",{className:"flex min-w-0 flex-1 flex-col",children:[a("div",{className:"flex flex-row items-center gap-x-2",children:[a("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1",children:[e,r(U,{children:n}),m&&r("span",{"data-slot":"item-status",className:"shrink-0",children:l})]}),le(l)&&!m&&r("span",{"data-slot":"item-status",className:"ms-auto shrink-0",children:l})]}),le(t)&&r("div",{className:o?"mt-0.5 flex":"mt-1",children:r(j,{subtitle:t,selected:d,note:!0,id:u})}),le(i)&&r("div",{"data-slot":"item-chips",className:"mt-2 flex flex-wrap gap-1.5",children:i})]})}function Ae({title:e,subtitle:t,chips:i,secondary:n,status:l,selected:c,compact:d=!0,subtitleId:o}){let u=le(i)||le(l);return a("div",{className:"flex min-w-0 flex-1 flex-col @xl:flex-row @xl:items-center @xl:gap-x-3",children:[a("div",{className:"flex min-w-0 flex-col @md:flex-row @md:flex-wrap @md:items-baseline @md:gap-x-2 @xl:flex-1",children:[e,r(U,{children:n}),r(j,{subtitle:t,selected:c,note:d,id:o})]}),u&&a("div",{"data-slot":"item-chips",className:"mt-1 flex flex-wrap gap-1 @xl:mt-0 @xl:shrink-0 @xl:justify-end",children:[l,i]})]})}var G=14,Ie=24,Se=7,Pe="shrink-0",je="min-w-[5ch] shrink-[1000]";function Le(e){let t=Array.from(e);if(t.length<=G)return;let i=t.lastIndexOf("@");if(i>0&&t.length-i<=Ie)return[t.slice(0,i).join(""),t.slice(i).join("")];let n=t.slice(-14).findIndex((d)=>"@.-_".includes(d)),l=n>=0&&n<10?n+1:0,c=t.length-G+l;return[t.slice(0,c).join(""),t.slice(c).join("")]}function Te({head:e,tail:t,full:i}){return a(T,{children:[a("span",{"aria-hidden":"true",className:"flex min-w-0",children:[r("span",{"data-title-part":!0,className:`truncate ${Array.from(e).length<=Se?Pe:je}`,children:e}),r("span",{"data-title-part":!0,className:"min-w-0 shrink truncate",children:t})]}),r("span",{"data-title-full":!0,className:"sr-only",children:i})]})}var _e="a, button, [tabindex]";function $e({xs:e,dense:t,stacked:i,compact:n}){return e?"text-[13px] font-medium":t&&i?"text-base font-semibold":n?"text-[13px] font-medium":"font-semibold"}function Oe({title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,...c}){let d=i==="middle",o=d?1:t,u=d&&typeof e=="string"?Le(e):void 0,m=r(ft,{as:"span",id:n,className:s(o==null?"wrap-anywhere":["min-w-0",u?"flex":Fl(o)],$e(c)),children:u&&typeof e=="string"?r(Te,{head:u[0],tail:u[1],full:e}):e});return o==null?m:r(ki,{focusHost:l?_e:void 0,reveal:l?"long-press":"tap",children:m})}function Ee({title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,subtitle:c,subtitleId:d,compact:o,xs:u,selected:m,chips:f,secondary:p,status:h,statusPlacement:g,dense:x,stacked:b}){let w=r(Oe,{title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,xs:u,dense:x,stacked:b,compact:o});return x?r(ze,{title:w,subtitle:c,chips:f,secondary:p,status:h,statusPlacement:g,selected:m,compact:o,stacked:b,xs:u,subtitleId:d}):a("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,r(j,{subtitle:c,selected:m,id:d})]})}function Be({index:e,selected:t,selfStart:i}){return r("span",{"aria-hidden":!0,"data-slot":"item-index",className:s("w-6 shrink-0 text-center font-semibold tabular-nums",t?"text-foreground":"text-muted-foreground",i&&"self-start"),children:e})}function Fe(){return r(_n,{"aria-hidden":!0,"data-slot":"item-chevron",className:"size-4 shrink-0 text-muted-foreground rtl:-scale-x-100"})}function Y({leading:e,accent:t,index:i,trailing:n,chevron:l,title:c,titleLines:d,titleTruncate:o,subtitle:u,compact:m,xs:f,selected:p,chips:h,secondary:g,status:x,statusPlacement:b,alignSlots:w,dense:N,stacked:y,interactive:C,titleId:A,subtitleId:I}){return a(T,{children:[i!=null&&r(Be,{index:i,selected:p,selfStart:!!(N&&y)}),r(Ne,{align:w,selfStart:!!(N&&y),children:t==null?e:r(we,{accent:t,leading:e})}),r(Ee,{title:c,titleLines:d,titleTruncate:o,titleId:A,subtitle:u,subtitleId:I,compact:m,xs:f,selected:p,chips:h,secondary:g,status:x,statusPlacement:b,dense:N,stacked:y,interactive:C}),r(ke,{align:w,children:n}),l&&r(Fe,{})]})}function Re({children:e,disabled:t,tight:i,onNameLine:n,stack:l,stackIndent:c,bleed:d}){return r("div",{"data-slot":"item-actions",inert:t||void 0,className:s("relative z-10",n?"h-7 self-start":d,"flex shrink-0 items-center gap-1",i&&"pointer-coarse:gap-3",l&&"@max-sm:my-0 @max-sm:h-auto @max-sm:w-full @max-sm:flex-wrap @max-sm:self-auto",l&&c&&"@max-sm:ms-(--nxgt-stack-indent,3.5rem) @max-sm:w-[calc(100%-var(--nxgt-stack-indent,3.5rem))]"),children:e})}var J=(e)=>e.startsWith("data-")||e==="style";function We(e){return Object.fromEntries(Object.entries(e).filter(([t])=>J(t)))}function He(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!J(t)))}function Ve({props:e,tileAttrs:t,split:i,href:n,linkComponent:l,disabled:c,onClick:d,selected:o,pressed:u,rowClass:m,body:f}){let p=i?He(e):{...e,...t};if(n){let h={...p,"aria-current":p["aria-current"]??(o?"page":void 0),"aria-disabled":c||p["aria-disabled"]||void 0,className:m,onClick:d};return l&&!c?r(l,{...h,href:n,children:f}):r("a",{...h,href:c?void 0:n,children:f})}return d?r("button",{...p,type:"button","aria-pressed":u,disabled:c,className:m,onClick:d,children:f}):r("div",{...p,className:m,children:f})}function qe({props:e,tileAttrs:t,className:i,row:n,actions:l,hasActions:c,reserve:d,hasContent:o,content:u,disabled:m,tight:f,alignActions:p,stackActions:h,stackIndent:g,actionsBleed:x}){return a("div",{...We(e),...t,className:i,children:[n,c&&r(Re,{disabled:m,tight:f,onNameLine:p,stack:h,stackIndent:g,bleed:x,children:l}),d&&r("div",{"aria-hidden":!0,"data-slot":"item-actions-reserve",className:"w-(--nxgt-reserved-actions,2.25rem) shrink-0"}),o&&r("div",{"data-slot":"item-content",inert:m||void 0,className:"relative z-10 w-full basis-full",children:u})]})}var Q=E(void 0);Q.Provider;function De(e){let t=P(Q);return e??t??"comfortable"}var X=E(void 0);X.Provider;function Ge(e){let t=P(X);return e??t??!1}var Z=E(void 0);Z.Provider;function Ke(e){let t=P(Z);return e??t??!1}function Me(e){return{comfortable:De(e.density)==="comfortable",alignSlots:Ge(e.alignSlots)}}var Ue="px-[calc(var(--nxgt-card-text-inset,calc(var(--nxgt-card-pad,1.5rem)+var(--nxgt-card-border,1px)))-var(--nxgt-card-border,1px))]";function ee({compact:e,selected:t,interactive:i,disabled:n,className:l,split:c,divided:d,plain:o,dense:u,inset:m,wrap:f,stack:p,comfortable:h,xs:g,start:x}){return s(c&&"relative",u&&"@container",f&&"flex-wrap",p&&"@container flex-wrap","nxgt-plain-link flex w-full items-center text-left pointer-coarse:min-h-11 [&_[data-slot=icon-button]]:rounded-[var(--nxgt-icon-button-radius,0.25rem)]","[&_svg:not([class*='size-'])]:size-4",x&&"items-start [&>svg]:mt-0.5",d?s("gap-2 rounded-none",!t&&"bg-card",h?g?"py-2":"py-3":"py-1.5",m==="card"?Ue:m==="none"?"px-0":m?"px-4":g?"px-0":"px-1"):e?s("gap-2 rounded px-2 py-1.5",u&&!t&&!o&&"bg-card",o&&!t&&"bg-card"):s("center gap-4 rounded p-2 px-4",!t&&"bg-card"),t&&s("nxgt-tile-selected",d&&"nxgt-tile-flat"),i&&s("cursor-pointer transition-colors",e&&!d&&"duration-200",!t&&(d||o?"hover:bg-card-tint-5":"hover:bg-card-tint-20")),n&&"pointer-events-none opacity-50",l)}function Ye(e,t,i=!1,n=!1){return s(i&&"@max-sm:basis-full","nxgt-plain-link flex min-w-0 flex-1 items-center text-left outline-none pointer-coarse:min-h-11",e?"gap-2":"gap-4",n&&"items-start [&>svg]:mt-0.5",t&&"after:absolute after:inset-0 after:rounded after:content-[''] focus-visible:after:ring-2 focus-visible:after:ring-ring")}function Je({compact:e,divided:t,comfortable:i,xs:n}){return t?i?n?"-my-2":"-my-3":"-my-1.5":e?"-my-1.5":"-my-2"}function Qe(e){let t=e.actions!=null&&e.actions!==!1,i=le(e.content),n=e.variant==="divided"||le(e.chips)||le(e.secondary)||le(e.status);return{interactive:!!(e.href||e.onClick),compact:e.size==="sm"||e.size==="xs",hasActions:t,hasContent:i,dense:n,reserve:!t&&!!e.reserveActions,split:t||!!e.reserveActions||n||i}}function Xe({variant:e,...t}){let i=ee({...t,divided:e==="divided",plain:e==="plain"});return{classes:i,rowClass:t.split?Ye(t.compact,t.interactive,t.stack??!1,t.start):i}}function Ze({compact:e,comfy:t,dense:i,size:n,variant:l,status:c,actionsAlign:d}){return{tight:i&&e,alignActions:d==="name"||t&&le(c),actionsBleed:Je({compact:e,comfortable:t,xs:n==="xs",divided:l==="divided"})}}function et(e){let{comfortable:t,alignSlots:i}=Me({density:e.density,alignSlots:e.alignSlots}),n=Ke(e.reserveActions),l=Qe({...e,reserveActions:n}),{interactive:c,compact:d,hasActions:o,hasContent:u,dense:m,split:f}=l,p=o&&e.actionsPlacement==="stack",h=m&&t,g=e.chevron??(!!e.href&&!o&&!(m&&t)),{classes:x,rowClass:b}=Xe({compact:d,selected:e.selected,interactive:c,split:f,dense:m,disabled:e.disabled,className:e.className,inset:e.inset,variant:e.variant??"tonal",stack:p,comfortable:h,wrap:u,xs:e.size==="xs",start:e.align==="start"});return{comfortable:t,alignSlots:i,chevron:g,stack:p,flags:l,boxProps:{hasActions:o,hasContent:u,reserve:l.reserve,...Ze({compact:d,comfy:h,dense:m,size:e.size,status:e.status,actionsAlign:e.actionsAlign,variant:e.variant??"tonal"})},classes:x,rowClass:b}}var tt=(e)=>({"data-slot":"item-detail","data-selected":e||void 0});function it({title:e,titleLines:t,titleTruncate:i,subtitle:n,leading:l,index:c,trailing:d,alignSlots:o,align:u,chips:m,secondary:f,status:p,statusPlacement:h,accent:g,content:x,variant:b="tonal",inset:w,density:N,actions:y,reserveActions:C,actionsPlacement:A,actionsAlign:I,stackIndent:te,className:se,selected:L,size:_="md",href:O,chevron:ae,linkComponent:re,disabled:S,onClick:B,...F}){let z=L??!1,ce=ge(re),k=et({href:O,onClick:B,size:_,actions:y,reserveActions:C,content:x,variant:b,chips:m,secondary:f,status:p,selected:z,disabled:S,className:se,inset:w,actionsPlacement:A,actionsAlign:I,density:N,alignSlots:o,chevron:ae,align:u}),{alignSlots:R,comfortable:oe,chevron:me,stack:W}=k,{split:V,compact:ue,dense:pe}=k.flags,fe=r(Y,{leading:l,accent:g,index:c,trailing:d,title:e,subtitle:n,alignSlots:R,titleLines:t??(R?1:void 0),chips:m,secondary:f,status:p,statusPlacement:h,titleTruncate:i,chevron:me,compact:ue,selected:z,dense:pe,stacked:oe,interactive:k.flags.interactive,xs:_==="xs"}),q=tt(z),D=Ve({props:F,tileAttrs:q,split:V,href:O,linkComponent:ce,disabled:S,onClick:B,selected:z,pressed:L,rowClass:k.rowClass,body:fe});return V?r(qe,{props:F,tileAttrs:q,row:D,actions:y,content:x,disabled:S,className:k.classes,stackActions:W,stackIndent:W&&te===!0&&le(l),...k.boxProps}):D}function st({toggle:e,title:t,titleLines:i,titleTruncate:n,subtitle:l,leading:c,index:d,trailing:o,variant:u="tonal",inset:m,selected:f=!1,size:p="md",disabled:h,className:g,...x}){let b=H(),w=e.id??`${b}-switch`,N=`${b}-title`,y=le(l)?`${b}-subtitle`:void 0;return a("label",{...x,"data-slot":"item-detail","data-selected":f||void 0,htmlFor:w,className:ee({compact:p!=="md",selected:f,interactive:!e.readOnly,divided:u==="divided",plain:u==="plain",inset:m,disabled:h,className:g}),children:[r(Y,{leading:c,index:d,trailing:o,title:t,titleLines:i,titleTruncate:n,subtitle:l,compact:p!=="md",xs:p==="xs",selected:f,titleId:N,subtitleId:y}),r(No,{...e,disabled:h||e.disabled,id:w,"aria-labelledby":N,"aria-describedby":y,className:s("cursor-pointer",e.className)})]})}function at({as:e,titleBreak:t,...i}){let n=t==="smart"&&i.titleTruncate!=="middle"&&typeof i.title=="string"?he(i.title):i.title,l=r(nt,{...i,title:n});return e==="li"?r("li",{className:i.variant==="divided"?"border-b border-border/70 last:border-b-0":void 0,children:l}):l}function nt({toggle:e,...t}){if(e){let{href:i,onClick:n,actions:l,reserveActions:c,actionsPlacement:d,actionsAlign:o,chevron:u,chips:m,secondary:f,status:p,accent:h,content:g,linkComponent:x,alignSlots:b,align:w,...N}=t;return r(st,{...N,toggle:e})}return r(it,{...t})}var lt=["w-3/5","w-2/5","w-1/2"];function rt({children:e}){return a("div",{"data-slot":"option-list-loading",className:"grid gap-1 px-3 py-2",children:[r("span",{className:"text-muted-foreground text-xs",children:e}),r("div",{"aria-hidden":!0,className:"grid gap-1",children:lt.map((t)=>a("div",{className:"flex h-8 items-center gap-3",children:[r(ga,{className:"size-4 shrink-0 rounded-full"}),r(ga,{className:`h-3 ${t} rounded-full`})]},t))})]})}function xt({items:e,selectedIndex:t=0,id:i,onSelect:n,loading:l=!1,failed:c=!1,className:d}){let{t:o}=v(),u=H(),m=i??u,f=s("@container grid min-w-[220px] max-w-sm gap-0.5 rounded border border-border bg-background p-1 shadow",d),p=e.length===0,h=c?o("material.mentions.failed","The search failed"):l?o("material.mentions.loading","Loading…"):o("material.mentions.empty","No matches");return a("div",{"data-slot":"mention-list","aria-busy":l||void 0,className:f,children:[r("span",{role:"status",className:"sr-only",children:p?h:""}),l&&!p&&r("div",{"aria-hidden":!0,"data-slot":"mention-list-progress",className:"-mt-1 mb-0.5 h-1 animate-pulse rounded bg-primary-indicator"}),p?l&&!c?r(rt,{children:h}):r("p",{"aria-hidden":!0,className:s("px-3 py-2 text-sm",c?"text-error-text":"text-muted-foreground"),children:h}):r(ct,{id:m,items:e,selectedIndex:t,onSelect:n})]})}function ct({id:e,items:t,selectedIndex:i,onSelect:n}){let{t:l}=v();return r("div",{id:e,role:"listbox","aria-label":l("material.mentions.label","Mentions"),className:"grid gap-0.5",children:t.map((c,d)=>r(at,{id:zo(e,d),size:"sm",role:"option","aria-selected":d===i,selected:d===i,leading:c.avatar??r(Ti,{fallback:c.label.slice(0,1)}),title:c.label,subtitle:c.handle?`@${c.handle}`:void 0,onMouseDown:(o)=>o.preventDefault(),onClick:()=>n(c)},c.id))})}export{xt as MentionList};
|
|
1
|
+
import{de,ye,E,ie,P,H,T,r,a,s,v,ne,ft,No,_n,le,Fl,ga,ki,zo,Ti}from"./index.e35b4yh5.js";import{Ll}from"./index.nsckd1vt.js";function he(e){return typeof e=="string"?Ll(e).map((t,i,n)=>a(de,{children:[t.split(/(-+.?)/).map((l,c)=>l.startsWith("-")?r("span",{className:"whitespace-nowrap",children:l},c):l),i<n.length-1&&r("wbr",{})]},i)):e}var xe=E(void 0);function ge(e){let t=P(xe);return e??t}function ve({children:e,className:t,...i}){let n=!!(i["aria-label"]||i["aria-labelledby"]);return r(ne,{"data-slot":"icon-badge","aria-hidden":n?void 0:"true",role:n?"img":void 0,...i,asChild:!0,className:s("cursor-default",t),children:r("span",{children:e})})}var be={sm:"size-10 rounded-xl text-xl [&_svg:not([class*='size-'])]:size-5 [--nxgt-icon-size:1.25rem]",md:"size-12 rounded-2xl text-2xl [&_svg:not([class*='size-'])]:size-6 [--nxgt-icon-size:1.5rem]",lg:"size-14 rounded-2xl text-3xl [&_svg:not([class*='size-'])]:size-7 [--nxgt-icon-size:1.75rem]"};function K({children:e,size:t="md",variant:i="tonal",color:n="primary",className:l,...c}){return r(ve,{...c,"data-slot":"icon-tile",variant:i,color:n,className:s("shrink-0",be[t],l),children:e})}K.displayName="IconTile";function we({accent:e,leading:t}){if(e==null)return r(T,{children:t});if(!le(t))return r("span",{className:"flex h-6 shrink-0 items-center",children:r("span",{"aria-hidden":!0,"data-slot":"item-accent","data-tone":e,className:"size-2 rounded-full bg-tone-text"})});if(ie(t)&&t.type===Ti)return ye(t,{tone:t.props.tone??e});let i=ie(t)&&t.type===K,n=i?{sm:"size-10 [--nxgt-icon-size:1.25rem]",md:"size-12 [--nxgt-icon-size:1.5rem]",lg:"size-14 [--nxgt-icon-size:1.75rem]"}[t.props.size??"md"]:"size-9";return r("span",{"data-slot":"item-accent","data-tone":e,className:`inline-flex ${n} shrink-0 items-center justify-center rounded-full bg-tone-container text-tone-text shadow-[inset_0_0_0_1px_var(--nxgt-tone-ring)] [&_svg:not([class*='size-'])]:size-[var(--nxgt-icon-size,1rem)]`,children:i?t.props.children:t})}var M="[&>*]:max-w-full [&>*]:min-w-0 [&>*]:justify-start [&>*]:overflow-hidden [&>*]:text-ellipsis [&>*]:whitespace-nowrap";function Ne({children:e,align:t,selfStart:i}){return t?r("span",{"data-slot":"item-leading",className:s("flex w-(--nxgt-leading-width,5rem) min-w-0 shrink-0 items-center overflow-hidden",M,i&&"self-start"),children:e}):i&&le(e)?r("span",{className:"self-start",children:e}):r(T,{children:e})}function ke({children:e,align:t}){return t?r("span",{"data-slot":"item-trailing",className:s("flex w-(--nxgt-trailing-width,6rem) min-w-0 shrink-0 items-center justify-end overflow-hidden text-end",M),children:e}):r(T,{children:e})}function j({subtitle:e,selected:t,note:i,id:n}){return le(e)?r(ft,{as:"span",variant:i?"body-sm":void 0,id:n,className:s("wrap-anywhere",t?"text-foreground/70":"text-muted-foreground"),children:e}):null}var U=({children:e})=>le(e)?r("span",{className:"text-sm text-muted-foreground",children:e}):null;function ze(e){return e.stacked?r(Ce,{...e}):r(Ae,{...e})}function Ce({title:e,subtitle:t,chips:i,secondary:n,status:l,statusPlacement:c,selected:d,xs:o,subtitleId:u}){let m=c==="name"&&le(l);return a("div",{className:"flex min-w-0 flex-1 flex-col",children:[a("div",{className:"flex flex-row items-center gap-x-2",children:[a("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1",children:[e,r(U,{children:n}),m&&r("span",{"data-slot":"item-status",className:"shrink-0",children:l})]}),le(l)&&!m&&r("span",{"data-slot":"item-status",className:"ms-auto shrink-0",children:l})]}),le(t)&&r("div",{className:o?"mt-0.5 flex":"mt-1",children:r(j,{subtitle:t,selected:d,note:!0,id:u})}),le(i)&&r("div",{"data-slot":"item-chips",className:"mt-2 flex flex-wrap gap-1.5",children:i})]})}function Ae({title:e,subtitle:t,chips:i,secondary:n,status:l,selected:c,compact:d=!0,subtitleId:o}){let u=le(i)||le(l);return a("div",{className:"flex min-w-0 flex-1 flex-col @xl:flex-row @xl:items-center @xl:gap-x-3",children:[a("div",{className:"flex min-w-0 flex-col @md:flex-row @md:flex-wrap @md:items-baseline @md:gap-x-2 @xl:flex-1",children:[e,r(U,{children:n}),r(j,{subtitle:t,selected:c,note:d,id:o})]}),u&&a("div",{"data-slot":"item-chips",className:"mt-1 flex flex-wrap gap-1 @xl:mt-0 @xl:shrink-0 @xl:justify-end",children:[l,i]})]})}var G=14,Ie=24,Se=7,Pe="shrink-0",je="min-w-[5ch] shrink-[1000]";function Le(e){let t=Array.from(e);if(t.length<=G)return;let i=t.lastIndexOf("@");if(i>0&&t.length-i<=Ie)return[t.slice(0,i).join(""),t.slice(i).join("")];let n=t.slice(-14).findIndex((d)=>"@.-_".includes(d)),l=n>=0&&n<10?n+1:0,c=t.length-G+l;return[t.slice(0,c).join(""),t.slice(c).join("")]}function Te({head:e,tail:t,full:i}){return a(T,{children:[a("span",{"aria-hidden":"true",className:"flex min-w-0",children:[r("span",{"data-title-part":!0,className:`truncate ${Array.from(e).length<=Se?Pe:je}`,children:e}),r("span",{"data-title-part":!0,className:"min-w-0 shrink truncate",children:t})]}),r("span",{"data-title-full":!0,className:"sr-only",children:i})]})}var _e="a, button, [tabindex]";function $e({xs:e,dense:t,stacked:i,compact:n}){return e?"text-[13px] font-medium":t&&i?"text-base font-semibold":n?"text-[13px] font-medium":"font-semibold"}function Oe({title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,...c}){let d=i==="middle",o=d?1:t,u=d&&typeof e=="string"?Le(e):void 0,m=r(ft,{as:"span",id:n,className:s(o==null?"wrap-anywhere":["min-w-0",u?"flex":Fl(o)],$e(c)),children:u&&typeof e=="string"?r(Te,{head:u[0],tail:u[1],full:e}):e});return o==null?m:r(ki,{focusHost:l?_e:void 0,reveal:l?"long-press":"tap",children:m})}function Ee({title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,subtitle:c,subtitleId:d,compact:o,xs:u,selected:m,chips:f,secondary:p,status:h,statusPlacement:g,dense:x,stacked:b}){let w=r(Oe,{title:e,titleLines:t,titleTruncate:i,titleId:n,interactive:l,xs:u,dense:x,stacked:b,compact:o});return x?r(ze,{title:w,subtitle:c,chips:f,secondary:p,status:h,statusPlacement:g,selected:m,compact:o,stacked:b,xs:u,subtitleId:d}):a("div",{className:"flex min-w-0 flex-1 flex-col",children:[w,r(j,{subtitle:c,selected:m,id:d})]})}function Be({index:e,selected:t,selfStart:i}){return r("span",{"aria-hidden":!0,"data-slot":"item-index",className:s("w-6 shrink-0 text-center font-semibold tabular-nums",t?"text-foreground":"text-muted-foreground",i&&"self-start"),children:e})}function Fe(){return r(_n,{"aria-hidden":!0,"data-slot":"item-chevron",className:"size-4 shrink-0 text-muted-foreground rtl:-scale-x-100"})}function Y({leading:e,accent:t,index:i,trailing:n,chevron:l,title:c,titleLines:d,titleTruncate:o,subtitle:u,compact:m,xs:f,selected:p,chips:h,secondary:g,status:x,statusPlacement:b,alignSlots:w,dense:N,stacked:y,interactive:C,titleId:A,subtitleId:I}){return a(T,{children:[i!=null&&r(Be,{index:i,selected:p,selfStart:!!(N&&y)}),r(Ne,{align:w,selfStart:!!(N&&y),children:t==null?e:r(we,{accent:t,leading:e})}),r(Ee,{title:c,titleLines:d,titleTruncate:o,titleId:A,subtitle:u,subtitleId:I,compact:m,xs:f,selected:p,chips:h,secondary:g,status:x,statusPlacement:b,dense:N,stacked:y,interactive:C}),r(ke,{align:w,children:n}),l&&r(Fe,{})]})}function Re({children:e,disabled:t,tight:i,onNameLine:n,stack:l,stackIndent:c,bleed:d}){return r("div",{"data-slot":"item-actions",inert:t||void 0,className:s("relative z-10",n?"h-7 self-start":d,"flex shrink-0 items-center gap-1",i&&"pointer-coarse:gap-3",l&&"@max-sm:my-0 @max-sm:h-auto @max-sm:w-full @max-sm:flex-wrap @max-sm:self-auto",l&&c&&"@max-sm:ms-(--nxgt-stack-indent,3.5rem) @max-sm:w-[calc(100%-var(--nxgt-stack-indent,3.5rem))]"),children:e})}var J=(e)=>e.startsWith("data-")||e==="style";function We(e){return Object.fromEntries(Object.entries(e).filter(([t])=>J(t)))}function He(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!J(t)))}function Ve({props:e,tileAttrs:t,split:i,href:n,linkComponent:l,disabled:c,onClick:d,selected:o,pressed:u,rowClass:m,body:f}){let p=i?He(e):{...e,...t};if(n){let h={...p,"aria-current":p["aria-current"]??(o?"page":void 0),"aria-disabled":c||p["aria-disabled"]||void 0,className:m,onClick:d};return l&&!c?r(l,{...h,href:n,children:f}):r("a",{...h,href:c?void 0:n,children:f})}return d?r("button",{...p,type:"button","aria-pressed":u,disabled:c,className:m,onClick:d,children:f}):r("div",{...p,className:m,children:f})}function qe({props:e,tileAttrs:t,className:i,row:n,actions:l,hasActions:c,reserve:d,hasContent:o,content:u,disabled:m,tight:f,alignActions:p,stackActions:h,stackIndent:g,actionsBleed:x}){return a("div",{...We(e),...t,className:i,children:[n,c&&r(Re,{disabled:m,tight:f,onNameLine:p,stack:h,stackIndent:g,bleed:x,children:l}),d&&r("div",{"aria-hidden":!0,"data-slot":"item-actions-reserve",className:"w-(--nxgt-reserved-actions,2.25rem) shrink-0"}),o&&r("div",{"data-slot":"item-content",inert:m||void 0,className:"relative z-10 w-full basis-full",children:u})]})}var Q=E(void 0);Q.Provider;function De(e){let t=P(Q);return e??t??"comfortable"}var X=E(void 0);X.Provider;function Ge(e){let t=P(X);return e??t??!1}var Z=E(void 0);Z.Provider;function Ke(e){let t=P(Z);return e??t??!1}function Me(e){return{comfortable:De(e.density)==="comfortable",alignSlots:Ge(e.alignSlots)}}var Ue="px-[calc(var(--nxgt-card-text-inset,calc(var(--nxgt-card-pad,1.5rem)+var(--nxgt-card-border,1px)))-var(--nxgt-card-border,1px))]";function ee({compact:e,selected:t,interactive:i,disabled:n,className:l,split:c,divided:d,plain:o,dense:u,inset:m,wrap:f,stack:p,comfortable:h,xs:g,start:x}){return s(c&&"relative",u&&"@container",f&&"flex-wrap",p&&"@container flex-wrap","nxgt-plain-link flex w-full items-center text-left pointer-coarse:min-h-11 [&_[data-slot=icon-button]]:rounded-[var(--nxgt-icon-button-radius,0.25rem)]","[&_svg:not([class*='size-'])]:size-4",x&&"items-start [&>svg]:mt-0.5",d?s("gap-2 rounded-none",!t&&"bg-card",h?g?"py-2":"py-3":"py-1.5",m==="card"?Ue:m==="none"?"px-0":m?"px-4":g?"px-0":"px-1"):e?s("gap-2 rounded px-2 py-1.5",u&&!t&&!o&&"bg-card",o&&!t&&"bg-card"):s("center gap-4 rounded p-2 px-4",!t&&"bg-card"),t&&s("nxgt-tile-selected",d&&"nxgt-tile-flat"),i&&s("cursor-pointer transition-colors",e&&!d&&"duration-200",!t&&(d||o?"hover:bg-card-tint-5":"hover:bg-card-tint-20")),n&&"pointer-events-none opacity-50",l)}function Ye(e,t,i=!1,n=!1){return s(i&&"@max-sm:basis-full","nxgt-plain-link flex min-w-0 flex-1 items-center text-left outline-none pointer-coarse:min-h-11",e?"gap-2":"gap-4",n&&"items-start [&>svg]:mt-0.5",t&&"after:absolute after:inset-0 after:rounded after:content-[''] focus-visible:after:ring-2 focus-visible:after:ring-ring")}function Je({compact:e,divided:t,comfortable:i,xs:n}){return t?i?n?"-my-2":"-my-3":"-my-1.5":e?"-my-1.5":"-my-2"}function Qe(e){let t=e.actions!=null&&e.actions!==!1,i=le(e.content),n=e.variant==="divided"||le(e.chips)||le(e.secondary)||le(e.status);return{interactive:!!(e.href||e.onClick),compact:e.size==="sm"||e.size==="xs",hasActions:t,hasContent:i,dense:n,reserve:!t&&!!e.reserveActions,split:t||!!e.reserveActions||n||i}}function Xe({variant:e,...t}){let i=ee({...t,divided:e==="divided",plain:e==="plain"});return{classes:i,rowClass:t.split?Ye(t.compact,t.interactive,t.stack??!1,t.start):i}}function Ze({compact:e,comfy:t,dense:i,size:n,variant:l,status:c,actionsAlign:d}){return{tight:i&&e,alignActions:d==="name"||t&&le(c),actionsBleed:Je({compact:e,comfortable:t,xs:n==="xs",divided:l==="divided"})}}function et(e){let{comfortable:t,alignSlots:i}=Me({density:e.density,alignSlots:e.alignSlots}),n=Ke(e.reserveActions),l=Qe({...e,reserveActions:n}),{interactive:c,compact:d,hasActions:o,hasContent:u,dense:m,split:f}=l,p=o&&e.actionsPlacement==="stack",h=m&&t,g=e.chevron??(!!e.href&&!o&&!(m&&t)),{classes:x,rowClass:b}=Xe({compact:d,selected:e.selected,interactive:c,split:f,dense:m,disabled:e.disabled,className:e.className,inset:e.inset,variant:e.variant??"tonal",stack:p,comfortable:h,wrap:u,xs:e.size==="xs",start:e.align==="start"});return{comfortable:t,alignSlots:i,chevron:g,stack:p,flags:l,boxProps:{hasActions:o,hasContent:u,reserve:l.reserve,...Ze({compact:d,comfy:h,dense:m,size:e.size,status:e.status,actionsAlign:e.actionsAlign,variant:e.variant??"tonal"})},classes:x,rowClass:b}}var tt=(e)=>({"data-slot":"item-detail","data-selected":e||void 0});function it({title:e,titleLines:t,titleTruncate:i,subtitle:n,leading:l,index:c,trailing:d,alignSlots:o,align:u,chips:m,secondary:f,status:p,statusPlacement:h,accent:g,content:x,variant:b="tonal",inset:w,density:N,actions:y,reserveActions:C,actionsPlacement:A,actionsAlign:I,stackIndent:te,className:se,selected:L,size:_="md",href:O,chevron:ae,linkComponent:re,disabled:S,onClick:B,...F}){let z=L??!1,ce=ge(re),k=et({href:O,onClick:B,size:_,actions:y,reserveActions:C,content:x,variant:b,chips:m,secondary:f,status:p,selected:z,disabled:S,className:se,inset:w,actionsPlacement:A,actionsAlign:I,density:N,alignSlots:o,chevron:ae,align:u}),{alignSlots:R,comfortable:oe,chevron:me,stack:W}=k,{split:V,compact:ue,dense:pe}=k.flags,fe=r(Y,{leading:l,accent:g,index:c,trailing:d,title:e,subtitle:n,alignSlots:R,titleLines:t??(R?1:void 0),chips:m,secondary:f,status:p,statusPlacement:h,titleTruncate:i,chevron:me,compact:ue,selected:z,dense:pe,stacked:oe,interactive:k.flags.interactive,xs:_==="xs"}),q=tt(z),D=Ve({props:F,tileAttrs:q,split:V,href:O,linkComponent:ce,disabled:S,onClick:B,selected:z,pressed:L,rowClass:k.rowClass,body:fe});return V?r(qe,{props:F,tileAttrs:q,row:D,actions:y,content:x,disabled:S,className:k.classes,stackActions:W,stackIndent:W&&te===!0&&le(l),...k.boxProps}):D}function st({toggle:e,title:t,titleLines:i,titleTruncate:n,subtitle:l,leading:c,index:d,trailing:o,variant:u="tonal",inset:m,selected:f=!1,size:p="md",disabled:h,className:g,...x}){let b=H(),w=e.id??`${b}-switch`,N=`${b}-title`,y=le(l)?`${b}-subtitle`:void 0;return a("label",{...x,"data-slot":"item-detail","data-selected":f||void 0,htmlFor:w,className:ee({compact:p!=="md",selected:f,interactive:!e.readOnly,divided:u==="divided",plain:u==="plain",inset:m,disabled:h,className:g}),children:[r(Y,{leading:c,index:d,trailing:o,title:t,titleLines:i,titleTruncate:n,subtitle:l,compact:p!=="md",xs:p==="xs",selected:f,titleId:N,subtitleId:y}),r(No,{...e,disabled:h||e.disabled,id:w,"aria-labelledby":N,"aria-describedby":y,className:s("cursor-pointer",e.className)})]})}function at({as:e,titleBreak:t,...i}){let n=t==="smart"&&i.titleTruncate!=="middle"&&typeof i.title=="string"?he(i.title):i.title,l=r(nt,{...i,title:n});return e==="li"?r("li",{className:i.variant==="divided"?"border-b border-border/70 last:border-b-0":void 0,children:l}):l}function nt({toggle:e,...t}){if(e){let{href:i,onClick:n,actions:l,reserveActions:c,actionsPlacement:d,actionsAlign:o,chevron:u,chips:m,secondary:f,status:p,accent:h,content:g,linkComponent:x,alignSlots:b,align:w,...N}=t;return r(st,{...N,toggle:e})}return r(it,{...t})}var lt=["w-3/5","w-2/5","w-1/2"];function rt({children:e}){return a("div",{"data-slot":"option-list-loading",className:"grid gap-1 px-3 py-2",children:[r("span",{className:"text-muted-foreground text-xs",children:e}),r("div",{"aria-hidden":!0,className:"grid gap-1",children:lt.map((t)=>a("div",{className:"flex h-8 items-center gap-3",children:[r(ga,{className:"size-4 shrink-0 rounded-full"}),r(ga,{className:`h-3 ${t} rounded-full`})]},t))})]})}function xt({items:e,selectedIndex:t=0,id:i,onSelect:n,loading:l=!1,failed:c=!1,className:d}){let{t:o}=v(),u=H(),m=i??u,f=s("@container grid min-w-[220px] max-w-sm gap-0.5 rounded border border-border bg-background p-1 shadow",d),p=e.length===0,h=c?o("material.mentions.failed","The search failed"):l?o("material.mentions.loading","Loading…"):o("material.mentions.empty","No matches");return a("div",{"data-slot":"mention-list","aria-busy":l||void 0,className:f,children:[r("span",{role:"status",className:"sr-only",children:p?h:""}),l&&!p&&r("div",{"aria-hidden":!0,"data-slot":"mention-list-progress",className:"-mt-1 mb-0.5 h-1 animate-pulse rounded bg-primary-indicator"}),p?l&&!c?r(rt,{children:h}):r("p",{"aria-hidden":!0,className:s("px-3 py-2 text-sm",c?"text-error-text":"text-muted-foreground"),children:h}):r(ct,{id:m,items:e,selectedIndex:t,onSelect:n})]})}function ct({id:e,items:t,selectedIndex:i,onSelect:n}){let{t:l}=v();return r("div",{id:e,role:"listbox","aria-label":l("material.mentions.label","Mentions"),className:"grid gap-0.5",children:t.map((c,d)=>r(at,{id:zo(e,d),size:"sm",role:"option","aria-selected":d===i,selected:d===i,leading:c.avatar??r(Ti,{fallback:c.label.slice(0,1)}),title:c.label,subtitle:c.handle?`@${c.handle}`:void 0,onMouseDown:(o)=>o.preventDefault(),onClick:()=>n(c)},c.id))})}export{xt as MentionList};
|