dsh-metaphysics 0.63.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +68 -0
- package/client.almanac.js +10 -10
- package/client.chart.js +132 -132
- package/client.chenggu.js +12 -12
- package/client.convert.js +14 -14
- package/client.daliuren.js +43 -43
- package/client.fengshui.js +3 -3
- package/client.js +204 -192
- package/client.liuyao.js +5 -5
- package/client.mbti.js +3 -3
- package/client.name.js +14 -14
- package/client.numerology.js +3 -3
- package/client.qimen.js +5 -5
- package/client.star.js +40 -40
- package/client.tarot.js +38 -38
- package/client.xiaoliuren.js +3 -3
- package/client.zeri.js +14 -14
- package/engine/diff.js +14 -0
- package/engine/index.js +4 -4
- package/engine/interpret.js +4 -3
- package/engine/ziwei.js +114 -19
- package/index.js +22 -2
- package/package.json +1 -1
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +193 -46
package/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.
|
|
1
|
+
window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.64.0",factory(Wt){const Tt=(function(){try{return Wt("react")}catch{return globalThis.React}})();if(!Tt)return{inject:[],apply(){}};const p=Tt.createElement,_a={bazi:"client.chart.js",ziwei:"client.chart.js",hepan:"client.chart.js",trend:"client.chart.js",name:"client.name.js",fengshui:"client.fengshui.js",liuyao:"client.liuyao.js",meihua:"client.liuyao.js",qimen:"client.qimen.js",daliuren:"client.daliuren.js",tarot:"client.tarot.js",almanac:"client.almanac.js",convert:"client.convert.js",zeri:"client.zeri.js",chenggu:"client.chenggu.js",xiaoliuren:"client.xiaoliuren.js",star:"client.star.js",numerology:"client.numerology.js",mbti:"client.mbti.js"},Ha=[{key:"general",label:"综合",dim:null,focus:""},{key:"wealth",label:"财运",dim:"work",focus:"钱财进出的落点主要看「工作与职业选择」与「事业发展」这两条。"},{key:"career",label:"事业",dim:"career",focus:"事业发展这条与你的问题最直接。"},{key:"love",label:"感情",dim:"love",focus:"感情这条与你的问题最直接。"},{key:"health",label:"健康",dim:"health",focus:"健康这条与你的问题最直接;下面只作提醒,不作任何诊断。"},{key:"study",label:"学业",dim:"career",focus:"学业与考试更贴近「事业发展」这条,讲的是长期积累与阶段进展。"},{key:"travel",label:"出行",dim:"overall",focus:"出行与迁动更贴近「整体运势」这条,看的是当下这一段的大环境。"}];window.__MP_VER="0.64.0",window.__MPGroups=[{title:"问一件事",hint:"心里有一件具体的事,起一卦再决定",items:[{k:"liuyao",label:"六爻",tip:"摇六次,问一件事"},{k:"meihua",label:"梅花",tip:"见闻起卦,看当下"},{k:"tarot",label:"塔罗",tip:"抽牌,看关系与选择"},{k:"qimen",label:"奇门",tip:"看方位、时机与取舍"},{k:"daliuren",label:"六壬",tip:"占事,断来意与结果"},{k:"xiaoliuren",label:"小六壬",tip:"掐指一算,快速断"}]},{title:"看一个人",hint:"看自己或身边人的性情、格局与运程",items:[{k:"bazi",label:"八字",tip:"四柱看一生格局"},{k:"ziwei",label:"紫微",tip:"十二宫细看"},{k:"hepan",label:"合盘",tip:"两个人合不合"},{k:"mbti",label:"人格",tip:"16 型性格问卷"},{k:"chenggu",label:"称骨",tip:"按生辰称命重"},{k:"numerology",label:"数字",tip:"生日数字看性格"},{k:"trend",label:"人生K",tip:"一生高低走势",wide:!0}]},{title:"查日子",hint:"挑时间、换农历,顺带看看家里和名字",items:[{k:"almanac",label:"黄历",tip:"今天宜忌、时辰吉凶"},{k:"zeri",label:"择日",tip:"挑个办事的好日子"},{k:"convert",label:"农历",tip:"公历农历互转"},{k:"star",label:"星座",tip:"星座性格与今日运"},{k:"fengshui",label:"风水",tip:"房屋朝向与布置"},{k:"name",label:"起名",tip:"按八字选字"}]}],window.__MP_UNRELEASED=[];const U={};U.DIRECTIONS=Ha,U.compute=()=>{throw new Error("命理引擎尚未加载")};const Oa=Object.create(null),ba=Object.create(null);function Oi(s){return _a[s]||_a.bazi||"client.chart.js"}const Fa=()=>typeof performance<"u"&&performance.now?performance.now():Date.now();async function Fi(s){const n=Oi(s);let q=Oa[n];const D=!!q,V=Fa();if(!q){if(!Wt||typeof Wt.async!="function")throw new Error("当前宿主不支持客户端分块加载(require.async 缺失),请升级 DeepSeek Harness");let te=ba[n];te||(te=Wt.async(`./${n}`).then(ie=>{const oe=ie&&(ie.Engine||ie.default);if(!oe||typeof oe.compute!="function")throw new Error(`命理引擎分块 ${n} 未返回 Engine`);return Oa[n]=oe,oe}),ba[n]=te,te.catch(()=>{}).then(()=>{delete ba[n]})),q=await te}for(const te of Object.keys(q))q[te]!==void 0&&(U[te]=q[te]);return Array.isArray(U.DIRECTIONS)||(U.DIRECTIONS=Ha),window.Engine=U,window.__MP_ENGINE_READY__=!0,window.__MP_LAST_LOAD={tab:s,chunk:n,cached:D,ms:Math.round((Fa()-V)*10)/10},U}window.__mpEnsureEngine=Fi,window.Engine=U,(function(){const s={liuyao:!0,meihua:!0,daliuren:!0,tarot:!0},n=G=>!!s[G],q={general:"other",wealth:"business",career:"career",love:"love",health:"other",study:"career",travel:"action"},D=G=>q[G]||"other",V="#ffffff",te="#1c1a15";function ie(G){const Z=String(G??"").match(/rgba?\(([^)]+)\)/i);if(!Z)return null;const R=Z[1].split(/[,\s/]+/).filter(Boolean).map(Number);return R.length<3||R.slice(0,3).some(K=>!Number.isFinite(K))||R.length>3&&Number.isFinite(R[3])&&R[3]<.95?null:[R[0],R[1],R[2]]}function oe(G){const Z=String(G||"").replace("#",""),R=Z.length===3?Z.split("").map(K=>K+K).join(""):Z;return/^[0-9a-f]{6}$/i.test(R)?[0,2,4].map(K=>parseInt(R.slice(K,K+2),16)):null}function a(G){const Z=R=>{const K=R/255;return K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4)};return .2126*Z(G[0])+.7152*Z(G[1])+.0722*Z(G[2])}function fe(G,Z){const R=a(G),K=a(Z),ve=Math.max(R,K),$t=Math.min(R,K);return(ve+.05)/($t+.05)}function ze(G){const Z=typeof G=="string"?ie(G):G;return Z?fe(Z,oe(V))>=fe(Z,oe(te))?V:te:""}function O(G){const Z=String(G??"").trim();if(!Z)return{lines:null,warning:""};const R=Z.split(/[^0-9]+/).filter(Boolean).map(Number),K=R.filter(ve=>![6,7,8,9].includes(ve));return R.length===6&&K.length===0?{lines:R,warning:""}:{lines:null,warning:R.length!==6?`爻值需要正好 6 个数字(当前 ${R.length} 个),本次按随机摇卦。`:`爻值只能是 6/7/8/9(收到 ${K.join("/")}),本次按随机摇卦。`}}function he(G){const Z=String(G??"").trim();if(!Z)return null;const R=Number(Z);return Number.isFinite(R)?R:null}function xe(G){const Z=G instanceof Date?G:new Date,R=K=>String(K).padStart(2,"0");return`${Z.getFullYear()}-${R(Z.getMonth()+1)}-${R(Z.getDate())}`}window.__MPCore={NEED_ASK:s,needAsk:n,parseLines:O,toNumber:he,parseRGB:ie,hexToRGB:oe,luminance:a,contrastRatio:fe,pickOnColor:ze,ON_DARK:V,ON_LIGHT:te,kindOfDirection:D,todayStamp:xe}})(),(function(){const s=`
|
|
2
2
|
.pp,.mp-it,.mp-al,.mp-cg,.mp-cl,.mp-cli,.mp-kline,.mp-mb,.mp-mb-paper,.mp-nm,.mp-quick,.mp-cdiff,.mp-shadow,.mp-trace-card,.mp-trace-layer,.mp-prof{--ink:#1b1b1b;--ink2:#3f3a33;--muted:#6f6a60;--label:#8a8378;--faint:#a9a296;
|
|
3
3
|
--line:#c8c1b2;--dimline:#b9b2a4;--hair:#e9e2d3;
|
|
4
4
|
/* 底色略沉作「桌面」,--card 跳到近白:原先 bg 与 card 只差 1/255,卡片感等于零。
|
|
@@ -73,9 +73,8 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
73
73
|
/* 大限/流年四化:只留色框不填充,与生年四化的实心块区分 */
|
|
74
74
|
.pp-m.view{background:transparent;box-shadow:inset 0 0 0 1px currentColor}
|
|
75
75
|
.pp-m.view.lu{color:var(--lu)}.pp-m.view.quan{color:var(--quan)}.pp-m.view.ke{color:var(--ke)}.pp-m.view.ji{color:var(--ji)}
|
|
76
|
-
/*
|
|
77
|
-
.pp-m.self
|
|
78
|
-
.pp-m.self.lu{color:var(--lu)}.pp-m.self.quan{color:var(--quan)}.pp-m.self.ke{color:var(--ke)}.pp-m.self.ji{color:var(--ji)}
|
|
76
|
+
/* 自化:宫干化回本宫。0.64.0 起不再用徽章,改在星名后画彩色小箭头(见 .pp-zha),
|
|
77
|
+
与生年实心块、大限/流年空心框分成三层——所以这里不再保留 .pp-m.self 样式 */
|
|
79
78
|
/* 庙旺得利平不陷:星名后的等级小字。刻意压低视觉权重(灰为主、陷才微红),
|
|
80
79
|
避免与四化的实心彩色方块抢层次 */
|
|
81
80
|
.pp-b{font-style:normal;font-size:10px;margin-left:3px;padding:0 3px;border-radius:999px;color:var(--muted);letter-spacing:0;opacity:.92;background:var(--band)}
|
|
@@ -181,11 +180,21 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
181
180
|
#ppm-sc-feixing:checked~.pp-body .pp-fx{display:block}
|
|
182
181
|
#ppm-sc-feixing:checked~.pp-body .pp-m.view,
|
|
183
182
|
#ppm-sc-feixing:checked~.pp-body .pp-viewhua{display:none}
|
|
184
|
-
/* 三合派:四化信息整体退场(生年/自化/大限流年/图例/飞星链 chips
|
|
183
|
+
/* 三合派:四化信息整体退场(生年/自化/大限流年/图例/飞星链 chips/自化箭头) */
|
|
185
184
|
#ppm-sc-sanhe:checked~.pp-body .pp-m,
|
|
186
|
-
#ppm-sc-sanhe:checked~.pp-body .pp-
|
|
185
|
+
#ppm-sc-sanhe:checked~.pp-body .pp-zha,
|
|
187
186
|
#ppm-sc-sanhe:checked~.pp-body .pp-viewhua,
|
|
188
187
|
#ppm-sc-sanhe:checked~.pp-flywrap{display:none}
|
|
188
|
+
/* 自化箭头(学文墨天机):自化是「宫干化回本宫」,箭头画在星名左边、箭头尖顶住星名,
|
|
189
|
+
由左向右弧着落回这颗星——读成「这笔化飞出去又落回自己」。
|
|
190
|
+
为什么必须放星名左边:放右边箭头就朝外,视觉上成了「从本宫飞出去」,意思正好反了。
|
|
191
|
+
为什么 inline 在星名旁而不是绝对定位:宫格左侧会被满星曜的宫撞上(实测压住「紫微 庙」)。 */
|
|
192
|
+
.pp-zha{display:inline-block;margin-right:3px;vertical-align:-1px;line-height:0;cursor:help}
|
|
193
|
+
.pp-zha .z-a{width:19px;height:8px;display:block;overflow:visible}
|
|
194
|
+
.pp-zha .z-shaft{fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round}
|
|
195
|
+
.pp-zha .z-head{fill:currentColor;stroke:none}
|
|
196
|
+
.pp-zha.lu{color:var(--lu)}.pp-zha.quan{color:var(--quan)}
|
|
197
|
+
.pp-zha.ke{color:var(--ke)}.pp-zha.ji{color:var(--ji)}
|
|
189
198
|
#ppm-sc-sihe:checked~.pp-flywrap{display:block}
|
|
190
199
|
#ppm-sc-feixing:checked~.pp-flywrap{display:block}
|
|
191
200
|
/* 自化图示(文墨式图例行):箭头颜色跟四化色走 */
|
|
@@ -198,7 +207,6 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
198
207
|
.pp::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.5;
|
|
199
208
|
background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.29 0 0 0 0 0.24 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E")}
|
|
200
209
|
.pp>*{position:relative;z-index:1}
|
|
201
|
-
.pp-zh{margin-left:4px;white-space:nowrap}
|
|
202
210
|
.pp-borrow{font-size:9.5px;color:var(--muted);margin-top:1px;letter-spacing:.02em}
|
|
203
211
|
|
|
204
212
|
/* —— 宫位点击展开详情 + 三方四正联动 ——
|
|
@@ -239,6 +247,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
239
247
|
.pp-detail .dt-tri em{font-style:normal;color:var(--muted);font-size:12px;margin-left:5px}
|
|
240
248
|
.pp-detail .dt-tri em::before{content:"·";margin-right:3px}
|
|
241
249
|
.pp-detail .dt-empty{color:var(--faint);font-size:12.5px}
|
|
250
|
+
.pp-detail .dt-self{margin-right:10px;white-space:nowrap}
|
|
242
251
|
.pp-detail .hint{color:var(--faint);font-size:11.5px;margin-top:6px}
|
|
243
252
|
.pp-ss{display:flex;flex-wrap:wrap;gap:0 7px;font-size:12.5px;line-height:1.6}
|
|
244
253
|
.pp-bz .pp-ss{flex-direction:column;align-items:center;gap:0;font-size:11.5px;line-height:1.5}
|
|
@@ -1417,50 +1426,53 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1417
1426
|
.pp table tbody tr:hover{background:var(--hover)}
|
|
1418
1427
|
/* 结果卡阴影分层:默认最轻,hover 时浮起一档(只对可交互的卡,避免整页抖动) */
|
|
1419
1428
|
.pp{transition:box-shadow var(--dur) var(--ease)}
|
|
1420
|
-
`,
|
|
1421
|
-
<div class="pp-stars">${
|
|
1422
|
-
${
|
|
1429
|
+
`,n=window.__PP=window.__PP||{};n.CSS=s;const q={主星:"main",吉星:"good",煞星:"bad",辅星:"aux",杂曜:"aux"},D={禄:"lu",权:"quan",科:"ke",忌:"ji"},V={庙:"good",旺:"good",得:"mid",利:"mid",平:"mid",不:"bad",陷:"bad"},te={巳:[1,1],午:[1,2],未:[1,3],申:[1,4],辰:[2,1],酉:[2,4],卯:[3,1],戌:[3,4],寅:[4,1],丑:[4,2],子:[4,3],亥:[4,4]},ie={乾:[1,1,1],兑:[1,1,0],离:[1,0,1],震:[1,0,0],巽:[0,1,1],坎:[0,1,0],艮:[0,0,1],坤:[0,0,0]},oe=["初爻","二爻","三爻","四爻","五爻","上爻"],a=e=>String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),fe=(e,i,r)=>{const f=Math.round(43),x=e?`<rect x="0" y="${2.5}" width="104" height="7" rx="${1.6}" fill="currentColor"/>`:`<rect x="0" y="${2.5}" width="${f}" height="7" rx="${1.6}" fill="currentColor"/><rect x="${f+18}" y="${2.5}" width="${104-f-18}" height="7" rx="${1.6}" fill="currentColor"/>`;return`<svg class="mp-hex${i?" hex-on":""}${r?" "+r:""}" viewBox="0 0 104 12" preserveAspectRatio="none" aria-hidden="true" focusable="false">${x}</svg>`},ze={木:"M6 1.6V10.8M6 5.2 2.6 2.2M6 7.4 9.4 4.4",火:"M6 1.4C7.6 3.6 9.2 5.4 9.2 7.6A3.2 3.2 0 0 1 2.8 7.6C2.8 5.4 4.4 3.6 6 1.4Z",土:"M1.6 9.6h8.8M6 2.4v7.2M3.4 5.6h5.2",金:"M6 1.2 10.6 6 6 10.8 1.4 6Z",水:"M1.4 7.2C2.9 4.2 4.5 10.2 6 7.2 7.5 4.2 9.1 10.2 10.6 7.2"},O=e=>{const i=ze[e];return i?`<svg class="mp-wxi" viewBox="0 0 12 12" aria-hidden="true" focusable="false"><path d="${i}" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/></svg>`:""},he=e=>`<svg class="mp-trig" viewBox="0 0 14 10" aria-hidden="true" focusable="false">${(ie[e]||[0,0,0]).slice().reverse().map((l,o)=>{const c=o*4;return l?`<rect x="0" y="${c}" width="14" height="2" rx="0.6" fill="currentColor"/>`:`<rect x="0" y="${c}" width="5.6" height="2" rx="0.6" fill="currentColor"/><rect x="8.4" y="${c}" width="5.6" height="2" rx="0.6" fill="currentColor"/>`}).join("")}</svg>`;n._hexBar=fe,n._wxIcon=O,n._triGlyph=he;function xe(e,i,r){return!e||!e.length?"":e.map(l=>{const o=q[l.type]||"aux",c=l.mutagen?`<i class="pp-m ${D[l.mutagen]}">${l.mutagen}</i>`:"",d=i&&i[l.name],m=d?`<i class="pp-m view ${D[d]}">${d}</i>`:"",u=l.brightness?`<em class="pp-b ${V[l.brightness]||"mid"}">${l.brightness}</em>`:"",f=l.inTemple?'<em class="pp-b good">庙</em>':"",x=r&&r[l.name]?Ge(r[l.name],l.name):"";return`<span class="pp-st ${o}">${x}${l.name}${u}${f}${c}${m}</span>`}).join("")}function G(e){const i=[];for(let r=0;r<6;r++)i.push(e+r*12);return i.join(",")}const Z=["命宫","兄弟","夫妻","子女","财帛","疾厄","迁移","交友","官禄","田宅","福德","父母"],R=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],K=e=>(e%12+12)%12,ve=(e,i)=>e!==i&&[K(i+4),K(i+8),K(i+6)].includes(e);function $t(e,i,r,l,o,c){const d=te[e.branch]||[1,1],m=R.indexOf(e.branch),u=["pp-cell"];m===i?u.push("pp-soul"):ve(m,i)&&u.push("pp-tri"),e.isBody&&u.push("pp-shen"),d[0]===4&&u.push("pp-lastrow"),d[1]===4&&u.push("pp-lastcol");const f=e.shensha||{},x=Z[K(i-m)];let E="";if(m===i&&l){const S=L=>(q[L.type]||"")==="main";if(!(e.stars||[]).some(S)){const L=l.find(M=>R.indexOf(M.branch)===K(m+6)),j=L?(L.stars||[]).filter(S):[];j.length&&(E=`<div class="pp-borrow" title="命宫无主星,借对宫(迁移宫)主星">借 ${j.map(M=>M.name).join(" ")}</div>`)}}return`<div class="${u.join(" ")}" data-pi="${m}" data-view="${r}" role="button" tabindex="0" aria-expanded="false" style="grid-row:${d[0]};grid-column:${d[1]}">
|
|
1430
|
+
<div class="pp-stars">${xe(e.stars,o,Et(e))}</div>
|
|
1431
|
+
${E}
|
|
1423
1432
|
<div class="pp-ages">${G(e.xiaoxian.age)}</div>
|
|
1424
|
-
${
|
|
1433
|
+
${Oe(e,c)}
|
|
1425
1434
|
<div class="pp-foot">
|
|
1426
1435
|
<div class="ft-l">
|
|
1427
|
-
<span class="ft-dx">${
|
|
1428
|
-
<span>${
|
|
1429
|
-
<span>${
|
|
1436
|
+
<span class="ft-dx">${f.boshi} ${e.daxian.start}-${e.daxian.end}</span>
|
|
1437
|
+
<span>${f.jiangqian}</span>
|
|
1438
|
+
<span>${f.suiqi}</span>
|
|
1430
1439
|
</div>
|
|
1431
1440
|
<div class="ft-r">
|
|
1432
|
-
<span>${
|
|
1441
|
+
<span>${f.changsheng}</span>
|
|
1433
1442
|
<span>${e.ganzhi}</span>
|
|
1434
|
-
<span class="ft-pn">${
|
|
1443
|
+
<span class="ft-pn">${x}</span>
|
|
1435
1444
|
</div>
|
|
1436
1445
|
</div>
|
|
1437
|
-
</div>`}function
|
|
1438
|
-
|
|
1446
|
+
</div>`}function Ge(e,i){return`<span class="pp-zha ${D[e]}" title="自化${a(e)}:${a(i)}·宫干化回本宫"><svg class="z-a" viewBox="0 0 22 9" role="img" aria-label="自化${a(e)}">
|
|
1447
|
+
<path class="z-shaft" d="M1 7C6.6 7 11.4 5.6 17.2 3.2"/>
|
|
1448
|
+
<path class="z-head" d="M20.2 2 17.8 4.9 16.6 1.9Z"/>
|
|
1449
|
+
</svg></span>`}n._zhaMark=Ge;function Et(e){const i={};for(const r of e.selfHua||[])!r||!r.star||!D[r.type]||i[r.star]||(i[r.star]=r.type);return i}function Oe(e,i){const r=i&&i[e.branch]||[];if(!r.length)return"";const l=r.map(o=>`<i class="${D[o.type]||""}" title="${a(o.star)}化${a(o.type)}">${a(o.type)}<em>→${a(o.palace||"未上盘")}</em></i>`).join("");return`<div class="pp-fx">${a(e.ganzhi)}宫干 ${l}</div>`}function _t(e){try{const i=window.Engine||window.__PP&&window.__PP.Engine;if(!i||!i.buildBazi||!e.input)return"";const r=i.buildBazi({year:e.input.year,month:e.input.month,day:e.input.day,hour:e.input.hour,minute:e.input.minute,gender:e.input.gender,trueSolar:!1});return["year","month","day","hour"].map(l=>r.pillars[l].ganzhi).join(" ")}catch{return""}}n.ziweiHTML=function(e){const i=R.indexOf(e.soul.branch),r=e.liunian&&e.liunian[0]||null,l=r?r.age:1,o=e.palaces.find(k=>l>=k.daxian.start&&l<=k.daxian.end)||e.palaces[0],c=R.indexOf(o.branch),d=r?R.indexOf(r.lifePalace.branch):i,m=k=>{const H={};for(const ee of k||[])ee&&ee.star&&(H[ee.star]=ee.type);return H},u=(e.daxianList||[]).find(k=>k.branch===o.branch)||null,f={da:m(u&&u.mutagenHits),ln:m(r&&r.mutagenHits)},x={};for(const k of e.daxianList||[])x[k.branch]=k.mutagenHits||[];const E=(k,H)=>e.palaces.map(ee=>$t(ee,k,H,e.palaces,f[H]||null,x)).join(""),S=(k,H)=>`<div class="pp-center">
|
|
1450
|
+
${H==="da"?`<div class="ct-t1">大限 ${o.ganzhi} ${o.daxian.start}-${o.daxian.end}岁</div>`:H==="ln"&&r?`<div class="ct-t1">流年 ${r.ganzhi} ${r.age}岁</div>`:`<div class="ct-t1">${e.daxian.rule.slice(0,2)} ${e.bureau.name}</div>`}
|
|
1439
1451
|
<div class="ct-t2">公历 ${e.input.year}-${String(e.input.month).padStart(2,"0")}-${String(e.input.day).padStart(2,"0")} ${String(e.input.hour).padStart(2,"0")}:${String(e.input.minute).padStart(2,"0")}</div>
|
|
1440
1452
|
<div class="ct-t2">农历 ${e.lunar.year}年${e.lunar.isLeap?`闰${e.lunar.monthRaw||e.lunar.month}`:e.lunar.month}月${e.lunar.day}日${e.hourBranch}时${e.lunar.isLeap&&e.lunar.monthRaw&&e.lunar.month!==e.lunar.monthRaw?`(按${e.lunar.month}月起盘)`:""}</div>
|
|
1441
|
-
${
|
|
1442
|
-
<div class="ct-t4">命主 ${e.lifeMaster} 身主 ${e.bodyMaster}${e.bodyMasterNote?`<span class="pp-dim" title="${a(e.bodyMasterNote)}">*</span>`:""}</div>
|
|
1453
|
+
${_t(e)?`<div class="ct-t3">${_t(e)}</div>`:""}
|
|
1454
|
+
<div class="ct-t4">命主 ${e.lifeMaster}${e.lifeMasterNote?`<span class="pp-dim" title="${a(e.lifeMasterNote)}">*</span>`:""} 身主 ${e.bodyMaster}${e.bodyMasterNote?`<span class="pp-dim" title="${a(e.bodyMasterNote)}">*</span>`:""}</div>
|
|
1443
1455
|
<div class="ct-t4">命宫 ${e.soul.branch} 身宫 ${e.body.branch} 五行局 ${e.bureau.name}</div>
|
|
1444
1456
|
<div class="ct-t4">子年斗君 ${e.doujun?e.doujun.zinian:"—"} 流年斗君 ${r&&r.doujun?r.doujun:"—"}</div>
|
|
1445
|
-
<div class="ct-t4">紫微 ${e.ziwei} 天府 ${e.tianfu} ${
|
|
1446
|
-
${
|
|
1447
|
-
<div class="pp-legend"><span class="pp-m lu">禄</span><span class="pp-m quan">权</span><span class="pp-m ke">科</span><span class="pp-m ji">忌</span><span>实心=生年四化 空心=大限/流年四化
|
|
1448
|
-
</div>`,
|
|
1457
|
+
<div class="ct-t4">紫微 ${e.ziwei} 天府 ${e.tianfu} ${H==="da"?"大限命宫 "+R[c]:H==="ln"?"流年命宫 "+R[d]:"本命命宫 "+e.soul.branch}</div>
|
|
1458
|
+
${H==="da"||H==="ln"?`<div class="ct-t4 pp-viewhua">${H==="da"?"大限":"流年"}四化 ${(H==="da"?f.da:f.ln)&&Object.keys(H==="da"?f.da:f.ln).length?Object.entries(H==="da"?f.da:f.ln).map(([$e,ue])=>`${$e}化${ue}`).join(" "):'<span class="pp-dim">未飞四化</span>'}</div>`:""}
|
|
1459
|
+
<div class="pp-legend"><span class="pp-m lu">禄</span><span class="pp-m quan">权</span><span class="pp-m ke">科</span><span class="pp-m ji">忌</span><span>实心=生年四化 空心=大限/流年四化 箭头=自化 红框=命宫 浅底=三方四正</span></div>
|
|
1460
|
+
</div>`,L=(k,H,ee)=>`<div class="pp-body ${k}" data-view="${ee}" data-soul="${H}"><div class="pp-grid">${E(H,ee)}${S(H,ee)}</div><div class="pp-detail"></div></div>`,j=e.changqu,M=j?`<div class="pp-chips">
|
|
1449
1461
|
<span class="pp-chip">昌 ${j.wenchang.branch}(${j.wenchang.palace})</span>
|
|
1450
1462
|
<span class="pp-chip">曲 ${j.wenqu.branch}(${j.wenqu.palace})</span>
|
|
1451
1463
|
<span class="pp-chip">${j.relation}</span>
|
|
1452
1464
|
<span class="pp-chip">入命三方 ${j.inSoulSanfang?"是":"否"}</span>
|
|
1453
1465
|
<span class="pp-chip ${j.absorb.label==="杂"?"warn":"ok"}">吸收·${j.absorb.label}</span>
|
|
1454
|
-
</div>`:"",
|
|
1466
|
+
</div>`:"",J=(e.patterns||[]).length?`<div class="pp-chips">${e.patterns.map(k=>{const H=k.status==="broken"&&Array.isArray(k.breaks)&&k.breaks.length,ee=`${k.evidence||""}${H?`;破格:${k.breaks.join(";")}`:""}`;return`<span class="pp-chip ${H?"broken":k.tone==="good"?"ok":k.tone==="bad"?"warn":""}" title="${a(ee)}">${k.name}${H?"(破格)":""}</span>`}).join("")}</div>`:"",P=(e.daxianList||[]).length?`<div class="pp-chips">${e.daxianList.slice(0,8).map(k=>`<span class="pp-chip" title="${a(`${k.ganzhi} 宫干四化:`+k.mutagenHits.map(H=>`${H.star}化${H.type}→${H.palace||"未上盘"}`).join("、"))}">${k.branch} ${k.ages[0]}-${k.ages[1]}</span>`).join("")}</div>`:"",w=r&&r.mutagenHits&&r.mutagenHits.length?`<div class="pp-chips">${r.mutagenHits.map(k=>`<span class="pp-chip ${k.type==="忌"?"warn":k.type==="禄"?"ok":""}">${k.star}化${k.type}→${k.palace||"未上盘"}</span>`).join("")}</div>`:"",z=e.zuoyao,ae=z?z.placed&&z.placed.length?`<div class="pp-sec"><div class="pp-sec-h">杂曜全表 · 已排 ${z.placed.length} 颗(${z.starTotal} 颗盘)</div>
|
|
1455
1467
|
<div class="pp-chips">${z.placed.map(k=>`<span class="pp-chip${k.inTemple?" ok":""}" title="${a(k.meaning||"")}">${a(k.name)} ${a(k.branch)}(${a(k.palace)})${k.inTemple?"·庙":""}</span>`).join("")}</div>
|
|
1456
1468
|
<details class="pp-zy"><summary>逐颗安星诀(${z.placed.length} 条 · 出多处近代通行辑本并核,属通行说,不是《全书》原文)</summary><div class="pp-zy-v">${a(z.verses).replace(/\n/g,"<br>")}</div></div></details>
|
|
1457
1469
|
${z.skipped&&z.skipped.length?`<div class="pp-zy-s">${z.skipped.map(k=>a(k)).join("")}</div>`:""}</div>`:`<div class="pp-sec"><div class="pp-sec-h">杂曜 · 本盘 ${z.starTotal} 颗(通行简盘)</div>
|
|
1458
|
-
<div class="pp-zy-s">开「杂曜全表」追加十二颗:解神·天巫·天月·阴煞(生月)/天官·天福·天厨(生年干)/蜚廉·天德·年解(生年支)/天才(命宫+生年支)·天寿(身宫+生年支)。${z.skipped&&z.skipped.length?`不另立:${z.skipped.map(k=>a(k)).join("")}`:""}</div></div>`:"",
|
|
1470
|
+
<div class="pp-zy-s">开「杂曜全表」追加十二颗:解神·天巫·天月·阴煞(生月)/天官·天福·天厨(生年干)/蜚廉·天德·年解(生年支)/天才(命宫+生年支)·天寿(身宫+生年支)。${z.skipped&&z.skipped.length?`不另立:${z.skipped.map(k=>a(k)).join("")}`:""}</div></div>`:"",F=e.flyChains?(()=>{const k=["禄","权","科","忌"].map(H=>{const ee=e.flyChains[H];if(!ee||!ee.steps.length)return"";const $e=ee.path.map(ge=>String(ge).replace(/宫$/,"")).join("→"),ue=ee.steps.map(ge=>`${ge.from}(${ge.fromStem})化${H}${ge.star}→${ge.to}`).join(";");return`<span class="pp-chip ${H==="忌"?"warn":H==="禄"?"ok":""}" title="${a(ue)}">飞${H} ${a($e)}${ee.closed?"↺":""}</span>`}).join("");return k?`<div class="pp-chips">${k}</div>`:""})():"",pe=e.flyComposite&&Array.isArray(e.flyComposite.labels)&&e.flyComposite.labels.length?`<div class="pp-chips">${e.flyComposite.labels.map(k=>{const H=/忌/.test(k)?"warn":/自化/.test(k)?"":"ok",ee=de=>String(de).replace(/^.*?会/,"").replace(/^禄忌同宫/,"").replace(/自化$/,""),$e=(e.flyComposite.targets||[]).find(de=>de.palace===ee(k)),ue=$e?$e.incoming.map(de=>`${de.from}化${de.type}${de.star}`).join("、"):e.flyComposite.note;return`<span class="pp-chip ${H}" title="${a(ue)}">三方四正 ${a(k)}</span>`}).join("")}</div>`:"",$=e.flow,me=$?(()=>{const k=ue=>(ue.mutagenHits||[]).length?ue.mutagenHits.map(de=>`<i>${de.star}化${de.type}<em>→${de.palace||"未上盘"}</em></i>`).join(""):'<i class="dim">宫干无四化</i>',H=(ue,de,ge)=>`<div class="flow-row"><b>${ue}</b><span class="flow-p"><span class="flow-k">${de.ganzhi||"—"} 落${de.palace||"未上盘"}(${de.branch})</span>${ge?`<em class="flow-same">${ge}</em>`:""}</span><span class="flow-m">${k(de)}</span></div>`,$e=$.day.branch===$.month.branch?"(日数走满一圈,故同宫)":"";return`<div class="pp-flow">
|
|
1459
1471
|
<div class="flow-row"><b>基准</b><span class="flow-p">${$.asOf.solar}</span><span class="flow-m">农历 ${$.asOf.lunar} 流年 ${$.asOf.yearGanzhi}(斗君 ${$.year.doujun})</span></div>
|
|
1460
|
-
${
|
|
1461
|
-
${
|
|
1462
|
-
${
|
|
1463
|
-
</div>`})():"";return
|
|
1472
|
+
${H(`流月 ${$.month.index} 月`,$.month)}
|
|
1473
|
+
${H(`流日 ${$.day.index} 日`,$.day,$e)}
|
|
1474
|
+
${H(`流时 ${R[$.hour.hourIndex]}时`,$.hour)}
|
|
1475
|
+
</div>`})():"";return n._zw=e,n.briefHTML(e)+`<div class="pp">
|
|
1464
1476
|
<input type="radio" name="ppm" id="ppm-ben" class="pp-r" checked>
|
|
1465
1477
|
<input type="radio" name="ppm" id="ppm-da" class="pp-r">
|
|
1466
1478
|
<input type="radio" name="ppm" id="ppm-ln" class="pp-r">
|
|
@@ -1474,76 +1486,76 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1474
1486
|
<div class="pp-modes pp-schools">
|
|
1475
1487
|
<label for="ppm-sc-sihe">四化</label><label for="ppm-sc-feixing">飞星</label><label for="ppm-sc-sanhe">三合</label>
|
|
1476
1488
|
</div>
|
|
1477
|
-
${
|
|
1478
|
-
${
|
|
1479
|
-
${
|
|
1480
|
-
<div class="pp-zhlegend">自化图示 <
|
|
1481
|
-
<div class="pp-flywrap">${
|
|
1482
|
-
</div>${
|
|
1489
|
+
${L("ben",i,"ben")}
|
|
1490
|
+
${L("da",c,"da")}
|
|
1491
|
+
${L("ln",d,"ln")}
|
|
1492
|
+
<div class="pp-zhlegend">自化图示 <span class="z-lu">${n._zhaMark("禄","本宫")}禄</span><span class="z-quan">${n._zhaMark("权","本宫")}权</span><span class="z-ke">${n._zhaMark("科","本宫")}科</span><span class="z-ji">${n._zhaMark("忌","本宫")}忌</span></div>
|
|
1493
|
+
<div class="pp-flywrap">${F}${pe}</div>
|
|
1494
|
+
</div>${me}${M}${J}${P}${w}${ae}`};function Be(e){return e.length?e.map(i=>{const r=q[i.type]||"aux",l=i.brightness?`<em class="dt-br ${V[i.brightness]||"mid"}">${i.brightness}</em>`:"",o=i.inTemple?'<em class="dt-br good">庙</em>':"",c=i.mutagen?`<i class="pp-m ${D[i.mutagen]}">${i.mutagen}</i>`:"";return`<span class="dt-st ${r}">${i.name}${l}${o}${c}</span>`}).join(""):'<span class="dt-empty">无</span>'}function Ht(e,i){const r=n._zw;if(!r)return"";const l=w=>r.palaces.find(z=>R.indexOf(z.branch)===w),o=l(e)||r.palaces.find(w=>R.indexOf(w.branch)===e);if(!o)return"";const c=R.indexOf(o.branch),d=Z[K(i-c)],m=o.shensha||{},u=o.stars.filter(w=>w.type==="主星"),f=o.stars.filter(w=>w.type==="吉星"||w.type==="辅星"),x=o.stars.filter(w=>w.type==="煞星"),E=o.stars.filter(w=>!["主星","吉星","辅星","煞星"].includes(w.type)),S=(o.selfHua||[]).length?o.selfHua.map(w=>`<span class="dt-self">${Ge(w.type,w.star||"本宫")}${a(w.star||"")}</span>`).join(""):'<span class="dt-empty">无</span>',L=[K(c+4),K(c+8),K(c+6)].map(w=>{const z=l(w),ae=Z[K(i-w)],F=z?z.stars.filter($=>$.type==="主星").map($=>$.name).join("、"):"",pe=w===K(c+6)?"对宫":"三合";return`<span class="dt-st">${ae}[${R[w]}]<b>${F||"无主星"}</b><em>${pe}</em></span>`}).join(""),j=l(K(c+6)),M=j?j.stars.filter(w=>w.type==="主星"):[],J=u.length?Be(u):`<span class="dt-empty">无主星</span><span class="dt-tri"> 借对宫 <b>${M.length?M.map(w=>w.name).join("、"):"亦无主星"}</b></span>`,P=(w,z)=>`<div class="dt-dr"><span class="dt-k">${w}</span><div class="dt-v">${z}</div></div>`;return`<div class="dt-dh">
|
|
1483
1495
|
<b>${d}</b><span>${o.branch}宫 · ${o.ganzhi}</span>
|
|
1484
1496
|
<span>大限 ${o.daxian.start}-${o.daxian.end}</span>
|
|
1485
1497
|
<span>小限起 ${o.xiaoxian.age} 岁</span>
|
|
1486
1498
|
${o.isBody?"<span>· 身宫</span>":""}
|
|
1487
1499
|
<span class="dt-x" data-pp-close="1">收起</span>
|
|
1488
1500
|
</div>
|
|
1489
|
-
${
|
|
1490
|
-
${
|
|
1491
|
-
${
|
|
1492
|
-
${
|
|
1493
|
-
${
|
|
1494
|
-
${
|
|
1495
|
-
${
|
|
1496
|
-
<div class="hint">三方四正在盘上已同步标出(浅红描边)。再点一次本宫可收起。</div>`}function
|
|
1497
|
-
<span class="mp-hy-nm">${o.name||
|
|
1498
|
-
${
|
|
1501
|
+
${P("主星",J)}
|
|
1502
|
+
${P("吉辅",Be(f))}
|
|
1503
|
+
${x.length?P("煞星",Be(x)):""}
|
|
1504
|
+
${E.length?P("杂曜",Be(E)):""}
|
|
1505
|
+
${P("宫干四化",S)}
|
|
1506
|
+
${P("十二神",`<span class="dt-tri">长生 ${m.changsheng||"—"} 博士 ${m.boshi||"—"} 将前 ${m.jiangqian||"—"} 岁前 ${m.suiqi||"—"}</span>`)}
|
|
1507
|
+
${P("三方四正",`<span class="dt-tri">${L}</span>`)}
|
|
1508
|
+
<div class="hint">三方四正在盘上已同步标出(浅红描边)。再点一次本宫可收起。</div>`}function et(e){e.querySelectorAll(".pp-cell.pp-sel,.pp-cell.pp-link").forEach(i=>{i.classList.remove("pp-sel"),i.classList.remove("pp-link")}),e.querySelectorAll('.pp-cell[aria-expanded="true"]').forEach(i=>i.setAttribute("aria-expanded","false"))}const za={};function wt(e,i){kt(e);const r=e.querySelector(".pp-grid");if(!r)return;const l=[i,(i+6)%12,(i+4)%12,(i+8)%12],o=u=>{const f=e.querySelector('.pp-cell[data-pi="'+u+'"]');if(!f)return null;const x=Number(f.style.gridRow),E=Number(f.style.gridColumn),S=Math.min(75,Math.max(25,(x-.5)*25));return E===1?[25,S]:[75,S]},c=l.map(o);if(c.some(u=>!u))return;const d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("class","pp-sf"),d.setAttribute("viewBox","0 0 100 100"),d.setAttribute("preserveAspectRatio","none");const m=(u,f,x,E)=>{const S=document.createElementNS("http://www.w3.org/2000/svg","line");S.setAttribute("x1",u),S.setAttribute("y1",f),S.setAttribute("x2",x),S.setAttribute("y2",E),d.appendChild(S)};m(c[0][0],c[0][1],c[1][0],c[1][1]),m(c[1][0],c[1][1],c[2][0],c[2][1]),m(c[2][0],c[2][1],c[3][0],c[3][1]),m(c[3][0],c[3][1],c[0][0],c[0][1]);for(let u=0;u<4;u++){const f=document.createElementNS("http://www.w3.org/2000/svg","circle");f.setAttribute("cx",c[u][0]),f.setAttribute("cy",c[u][1]),f.setAttribute("r",u===0?.9:.7),u===0&&f.setAttribute("style","fill:var(--red);opacity:.85"),d.appendChild(f)}r.style.position="relative",r.appendChild(d)}function kt(e){const i=e.querySelector("svg.pp-sf");i&&i.remove()}function Fe(){if(Fe.done||typeof document>"u"||!document.addEventListener)return;Fe.done=!0;const e=i=>{const r=i.closest(".pp-body");if(!r)return;const l=r.querySelector(".pp-detail");if(!l)return;if(i.classList.contains("pp-sel")){et(r),kt(r),l.classList.remove("open"),l.innerHTML="";return}et(r);const o=Number(i.dataset.pi),c=Number(r.dataset.soul);wt(r,o),r.querySelectorAll(".pp-cell").forEach(m=>{const u=Number(m.dataset.pi);(u===K(o+4)||u===K(o+8)||u===K(o+6))&&m.classList.add("pp-link")}),i.classList.add("pp-sel"),i.setAttribute("aria-expanded","true"),l.innerHTML=Ht(o,c),l.classList.add("open")};document.addEventListener("click",i=>{const r=i.target;if(r&&r.closest&&r.closest("[data-pp-close]")){const o=r.closest(".pp-body");if(o){et(o),kt(o);const c=o.querySelector(".pp-detail");c&&(c.classList.remove("open"),c.innerHTML="");return}}const l=r&&r.closest?r.closest(".pp-cell[data-pi]"):null;l&&e(l)}),document.addEventListener("keydown",i=>{if(i.key!=="Enter"&&i.key!==" ")return;const r=i.target&&i.target.closest?i.target.closest(".pp-cell[data-pi]"):null;r&&(i.preventDefault(),e(r))})}n.bindZiwei=Fe,n._palaceDetailHTML=Ht,Fe();function Ot(e,i){const r=i||{},l=e.slice().sort((o,c)=>c.position-o.position);return r.plain?l.map(o=>`<div class="mp-hy-row hy-plain">
|
|
1509
|
+
<span class="mp-hy-nm">${o.name||oe[o.position-1]}</span>
|
|
1510
|
+
${fe(o.yinYang==="阳",o.moving)}
|
|
1499
1511
|
</div>`).join(""):l.map(o=>{const c=o.yinYang==="阳",d=r.shiYing?o.position===r.shi?'<span class="mp-hy-sy">世</span>':o.position===r.ying?'<span class="mp-hy-sy">应</span>':"<span></span>":"<span></span>",m=o.moving?`<i class="mp-hy-mv" title="动爻">${c?"○":"×"}</i>`:'<i class="mp-hy-mv"></i>';return`<div class="mp-hy-row">
|
|
1500
1512
|
${d}
|
|
1501
|
-
<span class="mp-hy-nm">${o.name||
|
|
1502
|
-
<span class="mp-hy-ln">${
|
|
1513
|
+
<span class="mp-hy-nm">${o.name||oe[o.position-1]}</span>
|
|
1514
|
+
<span class="mp-hy-ln">${fe(c,o.moving)}${m}</span>
|
|
1503
1515
|
<span class="mp-hy-gz">${a(o.ganzhi||"")}</span>
|
|
1504
1516
|
<span class="mp-hy-lq">${a(o.liuqin||"")}</span>
|
|
1505
1517
|
<span class="mp-hy-ls">${a(o.liushen||"")}</span>
|
|
1506
|
-
</div>`}).join("")}
|
|
1518
|
+
</div>`}).join("")}n.liuyaoHTML=function(e){const i=(w,z,ae,F)=>`<div class="mp-hy-box">
|
|
1507
1519
|
<div class="mp-hy-h"><b>${w}</b><span>${z}</span></div>
|
|
1508
|
-
<div class="mp-hy">${
|
|
1520
|
+
<div class="mp-hy">${Ot(F,{shiYing:!0,shi:ae.shi,ying:ae.ying})}</div>
|
|
1509
1521
|
</div>`,r=i(`本卦 ${e.ben.name}`,`${e.ben.palace} · ${e.ben.palaceElement}`,e.ben,e.ben.lines),l=e.bian?i(`变卦 ${e.bian.name}`,`${e.bian.palace} · ${e.bian.palaceElement}`,e.bian,e.bian.lines):`<div class="mp-hy-box"><div class="mp-hy-h"><b>六爻安静</b><span>无动爻,不取变卦</span></div>
|
|
1510
|
-
<div class="pp-dim" style="font-size:12px;line-height:1.9">断卦以本卦卦辞与世应生克为主。</div></div>`,o=e.body&&Array.isArray(e.body.labels)?e.body.labels:[],c=o.length?`<div class="pp-chips">${o.map(w=>`<span class="pp-chip ${/伏吟/.test(w)||/反吟/.test(w)||/化退神/.test(w)?"warn":/六冲|散/.test(w)?"":"ok"}">${a(w)}</span>`).join("")}</div>`:'<div class="pp-chips"><span class="pp-chip">卦体无六冲、六合、伏吟、反吟</span></div>',d=e.useGod&&e.useGod.liuqin?e.useGod:null,m=d?`<div class="pp-chips">${d.labels.map(w=>`<span class="pp-chip ${/空亡|退神|受克|泄气|不上卦/.test(w)?"warn":/持世|化进|六合|得飞神生/.test(w)?"ok":""}">${a(w)}</span>`).join("")}</div>`:'<div class="pp-chips"><span class="pp-chip">用神未取(未指明所问之事)</span></div>',u=e.useGodStrength&&Array.isArray(e.useGodStrength.labels)?e.useGodStrength:null,
|
|
1522
|
+
<div class="pp-dim" style="font-size:12px;line-height:1.9">断卦以本卦卦辞与世应生克为主。</div></div>`,o=e.body&&Array.isArray(e.body.labels)?e.body.labels:[],c=o.length?`<div class="pp-chips">${o.map(w=>`<span class="pp-chip ${/伏吟/.test(w)||/反吟/.test(w)||/化退神/.test(w)?"warn":/六冲|散/.test(w)?"":"ok"}">${a(w)}</span>`).join("")}</div>`:'<div class="pp-chips"><span class="pp-chip">卦体无六冲、六合、伏吟、反吟</span></div>',d=e.useGod&&e.useGod.liuqin?e.useGod:null,m=d?`<div class="pp-chips">${d.labels.map(w=>`<span class="pp-chip ${/空亡|退神|受克|泄气|不上卦/.test(w)?"warn":/持世|化进|六合|得飞神生/.test(w)?"ok":""}">${a(w)}</span>`).join("")}</div>`:'<div class="pp-chips"><span class="pp-chip">用神未取(未指明所问之事)</span></div>',u=e.useGodStrength&&Array.isArray(e.useGodStrength.labels)?e.useGodStrength:null,f=u&&u.labels.length?`<div class="pp-chips">${u.labels.map(w=>`<span class="pp-chip ${/死|囚|月破|受日辰克|泄|耗/.test(w)?"warn":/旺|相|得日辰生|比和/.test(w)?"ok":""}">${a(w)}</span>`).join("")}</div>`:"",x=e.fushenAccess&&Array.isArray(e.fushenAccess.labels)?e.fushenAccess:null,E=x&&x.labels.length?`<div class="pp-chips">${x.labels.map(w=>`<span class="pp-chip ${/可出/.test(w)?"ok":/受压难出|有助有压/.test(w)?"warn":""}">伏神${a(w)}</span>`).join("")}</div>`:"",S=e.yingqi&&Array.isArray(e.yingqi.labels)?e.yingqi:null,L=S&&S.labels.length?`<div class="pp-chips">${S.labels.map(w=>`<span class="pp-chip ${/应期偏速/.test(w)?"ok":/应期待解/.test(w)?"warn":""}" title="只列地支,不出日期">${a(w)}</span>`).join("")}</div>`:"",j=e.jinTuiPower&&Array.isArray(e.jinTuiPower.labels)?e.jinTuiPower:null,M=j&&j.labels.length?`<div class="pp-chips">${j.labels.map(w=>`<span class="pp-chip ${/后劲足|退得缓/.test(w)?"ok":/有限|进得虚|退得实|月破|未定/.test(w)?"warn":""}">${a(w)}</span>`).join("")}</div>`:"",J=e.hexStrength&&Array.isArray(e.hexStrength.labels)?e.hexStrength:null,P=J&&J.labels.length?`<div class="pp-chips">${J.labels.map(w=>`<span class="pp-chip ${/死|囚|月破|冲空/.test(w)?"warn":/旺|相/.test(w)?"ok":""}">${a(w)}</span>`).join("")}</div>`:"";return n.briefHTML(e)+`<div class="pp" style="padding:14px">
|
|
1511
1523
|
<div class="mp-mh-head">起卦 ${e.cast.notation.join("、")}(自下而上) 日辰 ${e.dayGanZhi.name}</div>
|
|
1512
1524
|
<div class="mp-hy-wrap">${r}${l}</div>
|
|
1513
1525
|
${c}
|
|
1514
1526
|
${m}
|
|
1515
|
-
${
|
|
1516
|
-
${
|
|
1517
|
-
${
|
|
1518
|
-
${
|
|
1519
|
-
${
|
|
1520
|
-
</div>`},
|
|
1521
|
-
<div class="hb-h">${
|
|
1527
|
+
${f}
|
|
1528
|
+
${E}
|
|
1529
|
+
${L}
|
|
1530
|
+
${M}
|
|
1531
|
+
${P}
|
|
1532
|
+
</div>`},n.meihuaHTML=function(e){const i=(L,j,M,J,P)=>{const z=[...ie[J]||[0,0,0],...ie[M]||[0,0,0]].slice().reverse().map(ae=>fe(!!ae,!1,"sm")).join("");return`<div class="mp-hexbox hb-mini">
|
|
1533
|
+
<div class="hb-h">${L}</div>
|
|
1522
1534
|
<div class="hb-n">${j}</div>
|
|
1523
1535
|
<div class="mp-mh-mini">${z}</div>
|
|
1524
|
-
<div class="hb-s">${
|
|
1525
|
-
</div>`},r=e.lines.slice().sort((
|
|
1526
|
-
<div class="mp-trib-h">${
|
|
1527
|
-
<div class="mp-hy" style="gap:5px">${
|
|
1536
|
+
<div class="hb-s">${P||`上${M} 下${J}`}</div>
|
|
1537
|
+
</div>`},r=e.lines.slice().sort((L,j)=>j.position-L.position),l=r.slice(0,3),o=r.slice(3),c=e.moving>=4,d=(L,j,M,J)=>`<div class="mp-trib">
|
|
1538
|
+
<div class="mp-trib-h">${L} ${he(j)}${j}${Ze(j)}<span class="mp-tritag ${J?"tritag-ti":"tritag-yong"}">${J?"体":"用"}</span></div>
|
|
1539
|
+
<div class="mp-hy" style="gap:5px">${Ot(M,{plain:!0})}</div>
|
|
1528
1540
|
</div>`,m=`<div class="mp-hexbox">
|
|
1529
1541
|
<div class="hb-h"><span>本卦</span><span>动 ${e.movingName}</span></div>
|
|
1530
1542
|
<div class="hb-n">${e.ben.name}</div>
|
|
1531
1543
|
${d("上卦",e.ben.upper,l,!c)}
|
|
1532
1544
|
${d("下卦",e.ben.lower,o,c)}
|
|
1533
1545
|
<div class="hb-s">${e.source}</div>
|
|
1534
|
-
</div>`,u=e.bodyUse.level,
|
|
1546
|
+
</div>`,u=e.bodyUse.level,f=u.includes("凶")?"bad":u.includes("吉")?"good":"flat",x=`<div class="mp-mh-rel">
|
|
1535
1547
|
<div><b>体</b>${e.bodyUse.body.trigram}(${e.bodyUse.body.element}) <b>用</b>${e.bodyUse.use.trigram}(${e.bodyUse.use.element})</div>
|
|
1536
|
-
<div><span class="mh-lv ${
|
|
1537
|
-
</div>`,
|
|
1548
|
+
<div><span class="mh-lv ${f}">${u}</span> ${e.bodyUse.relation}</div>
|
|
1549
|
+
</div>`,E=ot(e.cuo.name)||["",""],S=ot(e.zong.name)||["",""];return n.briefHTML(e)+`<div class="pp mp-mh">
|
|
1538
1550
|
<div class="mp-mh-main">
|
|
1539
1551
|
${m}
|
|
1540
1552
|
${i("互卦",e.hu.name,e.hu.upper,e.hu.lower,"中藏之象")}
|
|
1541
1553
|
${i("变卦",e.bian.name,e.bian.upper,e.bian.lower,`动 ${e.movingName} 后`)}
|
|
1542
|
-
${i("错卦",e.cuo.name,
|
|
1554
|
+
${i("错卦",e.cuo.name,E[0],E[1],"六爻全变")}
|
|
1543
1555
|
${i("综卦",e.zong.name,S[0],S[1],"整卦倒转")}
|
|
1544
1556
|
</div>
|
|
1545
|
-
${
|
|
1546
|
-
</div>`};const
|
|
1557
|
+
${x}
|
|
1558
|
+
</div>`};const zt={乾为天:["乾","乾"],天风姤:["乾","巽"],天山遁:["乾","艮"],天地否:["乾","坤"],风地观:["巽","坤"],山地剥:["艮","坤"],火地晋:["离","坤"],火天大有:["离","乾"],坎为水:["坎","坎"],水泽节:["坎","兑"],水雷屯:["坎","震"],水火既济:["坎","离"],泽火革:["兑","离"],雷火丰:["震","离"],地火明夷:["坤","离"],地水师:["坤","坎"],艮为山:["艮","艮"],山火贲:["艮","离"],山天大畜:["艮","乾"],山泽损:["艮","兑"],火泽睽:["离","兑"],天泽履:["乾","兑"],风泽中孚:["巽","兑"],风山渐:["巽","艮"],震为雷:["震","震"],雷地豫:["震","坤"],雷水解:["震","坎"],雷风恒:["震","巽"],地风升:["坤","巽"],水风井:["坎","巽"],泽风大过:["兑","巽"],泽雷随:["兑","震"],巽为风:["巽","巽"],风天小畜:["巽","乾"],风火家人:["巽","离"],风雷益:["巽","震"],天雷无妄:["乾","震"],火雷噬嗑:["离","震"],山雷颐:["艮","震"],山风蛊:["艮","巽"],离为火:["离","离"],火山旅:["离","艮"],火风鼎:["离","巽"],火水未济:["离","坎"],山水蒙:["艮","坎"],风水涣:["巽","坎"],天水讼:["乾","坎"],天火同人:["乾","离"],坤为地:["坤","坤"],地雷复:["坤","震"],地泽临:["坤","兑"],地天泰:["坤","乾"],雷天大壮:["震","乾"],泽天夬:["兑","乾"],水天需:["坎","乾"],水地比:["坎","坤"],兑为泽:["兑","兑"],泽水困:["兑","坎"],泽地萃:["兑","坤"],泽山咸:["兑","艮"],水山蹇:["坎","艮"],地山谦:["坤","艮"],雷山小过:["震","艮"],雷泽归妹:["震","兑"]},Ft={乾:"金",兑:"金",离:"火",震:"木",巽:"木",坎:"水",艮:"土",坤:"土"},Ze=e=>Ft[e]?` ${Ft[e]}`:"",ot=e=>zt[e]||null;n.daliurenHTML=function(e){const i=e.sanChuan,r=(m,u)=>`<div class="mp-dl-sc-c">
|
|
1547
1559
|
<div class="mp-dl-sc-k">${u}</div>
|
|
1548
1560
|
<div class="mp-dl-sc-z">${m.zhi}</div>
|
|
1549
1561
|
<div class="mp-dl-sc-j">${m.jiangFull||m.jiang}</div>
|
|
@@ -1557,7 +1569,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1557
1569
|
<div class="mp-dl-sk-s">${m.shang}</div>
|
|
1558
1570
|
<div class="mp-dl-sk-x">${m.xia}</div>
|
|
1559
1571
|
<div class="mp-dl-sk-r">${m.relation} · ${m.jiangFull||m.jiang}</div>
|
|
1560
|
-
</div>`).join(""),c=e.pan.map(m=>{const u=
|
|
1572
|
+
</div>`).join(""),c=e.pan.map(m=>{const u=te[m.di]||[1,1];return`<div class="mp-dl-pc" style="grid-row:${u[0]};grid-column:${u[1]}">
|
|
1561
1573
|
<div class="tz">${m.tian}</div>
|
|
1562
1574
|
<div class="dz">地盘 ${m.di}</div>
|
|
1563
1575
|
<div class="jz">${m.jiangFull}</div>
|
|
@@ -1566,14 +1578,14 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1566
1578
|
<div class="dl-t2">${e.dayNight}贵 · 月将 ${e.yueJiang.name}${e.yueJiang.zhi} · 贵人${e.guiren.reverse?"逆":"顺"}行</div>
|
|
1567
1579
|
<div class="dl-t3">${i.chu.zhi} → ${i.zhong.zhi} → ${i.mo.zhi}</div>
|
|
1568
1580
|
<div class="dl-t2">节气 ${e.jieqi.name}${e.jieqi.time?" "+e.jieqi.time:""}</div>
|
|
1569
|
-
</div>`;return
|
|
1581
|
+
</div>`;return n.briefHTML(e)+`<div class="pp mp-dl">
|
|
1570
1582
|
<div class="mp-dl-head">日 ${e.dayGanZhi} 时 ${e.hourZhi}(${e.dayNight}贵) 月将 ${e.yueJiang.name}${e.yueJiang.zhi} 节气 ${e.jieqi.name} 贵人${e.guiren.reverse?"逆":"顺"}行</div>
|
|
1571
1583
|
<div class="mp-dl-sc">${r(i.chu,"初传")}${r(i.zhong,"中传")}${r(i.mo,"末传")}${l}</div>
|
|
1572
1584
|
<div class="mp-dl-sk">${o}</div>
|
|
1573
1585
|
<div class="mp-dl-pan2">${c}${d}</div>
|
|
1574
1586
|
${(e.shensha||[]).length?`<div class="mp-dl-ss"><b>神煞</b>${e.shensha.map(m=>`<span title="${a(m.note||"")}">${m.name}<i>${m.branch}</i></span>`).join("")}</div>`:""}
|
|
1575
1587
|
<div class="mp-dl-legend"><span>大字=天盘支</span><span>小字=地盘(固定十二支)</span><span>右下=天将</span></div>
|
|
1576
|
-
</div>`},
|
|
1588
|
+
</div>`},n.tarotHTML=function(e){const i=e.cards.map(o=>`
|
|
1577
1589
|
<div class="mp-tt-card ${o.upright?"tt-up":"tt-rev"}">
|
|
1578
1590
|
<div class="mp-tt-pos" title="${a(o.positionHint||"")}">${o.position}</div>
|
|
1579
1591
|
<div class="mp-tt-name">${o.name}${o.number?`<span class="mp-tt-no">${o.number}</span>`:""}</div>
|
|
@@ -1583,7 +1595,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1583
1595
|
${o.core?`<div class="mp-tt-core">${o.core}</div>`:""}
|
|
1584
1596
|
<div class="mp-tt-kw">${o.keywords.map(c=>`<span>${c}</span>`).join("")}</div>
|
|
1585
1597
|
<div class="mp-tt-el">${o.arcana} · ${o.element}${o.suit?" · "+o.suit+(o.rankCn?o.rankCn:""):""}${o.domain?" · "+o.domain:""}${o.astro?` · ${o.astro}`:o.role?` · ${o.role}`:""}</div>
|
|
1586
|
-
</div>`).join(""),r=e.question?a(e.question):'<span class="pp-dim">(未填写,可在上方输入后重抽)</span>',l=(e.reading||[]).map(o=>`<p>${a(o)}</p>`).join("");return
|
|
1598
|
+
</div>`).join(""),r=e.question?a(e.question):'<span class="pp-dim">(未填写,可在上方输入后重抽)</span>',l=(e.reading||[]).map(o=>`<p>${a(o)}</p>`).join("");return n.briefHTML(e)+`<div class="pp mp-tt">
|
|
1587
1599
|
<div class="mp-tt-q"><b>所问</b>${r}</div>
|
|
1588
1600
|
<div class="mp-tt-head">${e.spread}${e.castAt?` · 抽牌于 ${e.castAt}`:""}</div>
|
|
1589
1601
|
<div class="mp-tt-grid">${i}</div>
|
|
@@ -1593,12 +1605,12 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1593
1605
|
</div>
|
|
1594
1606
|
${e.systemNote?`<div class="mp-tt-tip">${e.systemNote}</div>`:""}
|
|
1595
1607
|
<div class="mp-tt-tip">塔罗用于自我觉察与娱乐,不作确定性预言。</div>
|
|
1596
|
-
</div>`};const
|
|
1608
|
+
</div>`};const tt=e=>{if(!e||!Array.isArray(e.pairs)||!e.pairs.length)return"";const r='<tr><th scope="col">一对</th><th scope="col">契合度</th>'+(e.pairs[0].dimensions||[]).map(d=>`<th scope="col">${a(d.label)}</th>`).join("")+"</tr>",l=e.pairs.map(d=>`<tr><th scope="row">${a(d.a)} × ${a(d.b)}</th><td>${d.total==null?"—":`${a(d.total)}/100`}<span class="mp-hp-lv">${a(d.level||"")}</span></td>`+(d.dimensions||[]).map(m=>`<td>${m.score>=0?"+":""}${a(m.score)}</td>`).join("")+"</tr>").join(""),o=e.spread>=3&&e.best?`最顺:<b>${a(e.best.a)} × ${a(e.best.b)}</b>(${a(e.best.total)}/100)`+(e.hardest?`;最需磨合:<b>${a(e.hardest.a)} × ${a(e.hardest.b)}</b>(${a(e.hardest.total)}/100)`:""):`三对分数接近(相差 ${a(e.spread)} 分),不排名`,c=e.focus&&e.focus.spread>=3?`<p>差异最大的一维:<b>${a(e.focus.label)}</b>(三对相差 ${a(e.focus.spread)} 分)</p>`:"";return`<div class="mp-hp-triple">
|
|
1597
1609
|
<div class="mp-hp-ith">三方合盘 · 三对并列</div>
|
|
1598
1610
|
<table><thead>${r}</thead><tbody>${l}</tbody></table>
|
|
1599
1611
|
<p>${o}</p>${c}
|
|
1600
1612
|
<p>${a(e.note||"")}</p>
|
|
1601
|
-
</div>`};
|
|
1613
|
+
</div>`};n.hepanHTML=function(e){const i=(l,o)=>`<div class="mp-hp-side">
|
|
1602
1614
|
<div class="mp-hp-who">${o}</div>
|
|
1603
1615
|
<div class="mp-hp-gz">${l.pillars.join(" ")}</div>
|
|
1604
1616
|
<div class="mp-hp-kv"><span>日主</span><b>${l.dayMaster}</b></div>
|
|
@@ -1608,13 +1620,13 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1608
1620
|
</div>`,r=e.dimensions.map(l=>`<div class="mp-hp-dim">
|
|
1609
1621
|
<div class="mp-hp-dimh"><span>${l.label}</span><b class="${l.score>=10?"good":l.score<0?"bad":""}">${l.score>=0?"+":""}${l.score}</b></div>
|
|
1610
1622
|
<div class="mp-hp-dimt">${l.text}</div>
|
|
1611
|
-
</div>`).join("");return
|
|
1623
|
+
</div>`).join("");return n.briefHTML(e)+`<div class="pp mp-hp">
|
|
1612
1624
|
<div class="mp-hp-head"><b>${e.score.level}</b><span>${e.score.total}/100</span></div>
|
|
1613
1625
|
<div class="mp-hp-sides">${i(e.a,"你")}${i(e.b,"对方")}</div>
|
|
1614
1626
|
<div class="mp-hp-dims">${r}</div>
|
|
1615
|
-
${
|
|
1627
|
+
${tt(e.triple)}
|
|
1616
1628
|
<div class="mp-hp-notes">${e.notes.map(l=>`<p>${l}</p>`).join("")}</div>
|
|
1617
|
-
</div>`},
|
|
1629
|
+
</div>`},n.qimenFactsHTML=function(e){if(!e||!e.palaces)return"";const i=(o,c)=>`<div class="relation__row"><dt>${a(o)}</dt><dd>${a(c)}</dd></div>`,r=o=>o&&["旺","相","休","囚","死"].filter(d=>Array.isArray(o[d])&&o[d].length).map(d=>`${d} ${o[d].join("、")}`).join(";")||"—";return`<dl class="relation mp-qm-facts" aria-label="奇门盘面事实">${[["局数",`${e.ju}${e.yuan?`(${e.yuan})`:""}`],["节气",`${e.jieqi||"—"}${e.jieqiTime?`(${e.jieqiTime})`:""}`],["四柱",`${e.siZhu?`${e.siZhu.year} ${e.siZhu.month} ${e.siZhu.day} ${e.siZhu.time}`:"—"}`],["值符",e.zhiFu?`${e.zhiFu.star} · ${e.zhiFu.gong}宫`:"—"],["值使",e.zhiShi?`${e.zhiShi.gate} · ${e.zhiShi.gong}宫`:"—"],["旬首",e.xunshou||"—"],["空亡",(e.kongWang||[]).join("")||"—"],["驿马",e.ma&&e.ma.zhi?`${e.ma.zhi}${e.ma.gong?`(${e.ma.gong}宫)`:""}`:"—"],["换局规则",e.juMethodNote||e.juMethod||"—"],["晚子时",e.lateZiHourMode==="next-day"?"23:00 后归次日":"23:00 后仍归当日"],["击刑",e.conditions&&e.conditions.jiXing&&e.conditions.jiXing.length?e.conditions.jiXing.map(o=>`${o.palace}宫${o.stem}`).join("、"):"本盘无"],["三奇入墓",e.conditions&&e.conditions.ruMu&&e.conditions.ruMu.length?e.conditions.ruMu.map(o=>`${o.palace}宫${o.stem}`).join("、"):"本盘无"],["六仪入墓",e.conditions&&e.conditions.liuYiRuMu&&e.conditions.liuYiRuMu.length?e.conditions.liuYiRuMu.map(o=>`${o.palace}宫${o.stem}`).join("、"):"本盘无"],["十干克应",[...e.palaces||[],e.centerPalace].filter(c=>c&&c.ganYing).map(c=>`${c.palace}宫 ${c.ganYing.tian}加${c.ganYing.di}「${c.ganYing.name}」`).join(";")||"—"],["月令",e.month&&e.month.branch?`${e.month.branch}(${e.month.element})`:"—"],["门旺衰",r(e.states&&e.states.gate)],["星旺衰",r(e.states&&e.states.star)],["干旺衰",r(e.states&&e.states.stem)],["干宫生克",(()=>{const o=["干克宫","宫克干","干生宫","宫生干","比和"],c={};for(const d of e.palaces||[]){const m=d.stemRelation||null;!m||m.type==="unknown"||!d.tianPan||(c[m.type]=c[m.type]||[]).push(d.tianPan)}return o.filter(d=>c[d]).map(d=>d+" "+c[d].join("、")).join(";")||"—"})()]].map(([o,c])=>i(o,c)).join("")}</dl>`};const jt=[["4","9","2"],["3","5","7"],["8","1","6"]];n.qimenHTML=function(e){const i={};for(const l of e.palaces)i[l.palace]=l;const r=l=>{if(l==="5")return`<div class="pp-qm-cell center">
|
|
1618
1630
|
<div class="pp-qm-ju">${e.ju}</div>
|
|
1619
1631
|
<div class="pp-qm-kv">${e.siZhu.year} ${e.siZhu.month}</div>
|
|
1620
1632
|
<div class="pp-qm-kv">${e.siZhu.day} ${e.siZhu.time}</div>
|
|
@@ -1626,7 +1638,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1626
1638
|
<div class="pp-qm-bot"><span>${o.anGan||""}</span><span class="no">${l}</span></div>
|
|
1627
1639
|
<div class="pp-qm-bot"><span class="dim">${o.stemRelation&&o.stemRelation.type!=="unknown"?o.stemRelation.type:""}</span><span class="dim">${o.stemState||""}</span></div>
|
|
1628
1640
|
<div class="pp-qm-bot"><span class="dim">${o.ganYing?a(`${o.ganYing.tian}加${o.ganYing.di} ${o.ganYing.name}`):""}</span></div>
|
|
1629
|
-
</div>`};return
|
|
1641
|
+
</div>`};return n.briefHTML(e)+`<div class="pp mp-qm">
|
|
1630
1642
|
<div class="mp-qm-head">
|
|
1631
1643
|
<b>${e.ju}</b>
|
|
1632
1644
|
<span>${e.siZhu.year} ${e.siZhu.month} ${e.siZhu.day} ${e.siZhu.time}</span>
|
|
@@ -1634,10 +1646,10 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1634
1646
|
<span>值符 ${e.zhiFu.star}(${e.zhiFu.gong}宫) 值使 ${e.zhiShi.gate}(${e.zhiShi.gong}宫)</span>
|
|
1635
1647
|
<span>旬首 ${e.xunshou} 空亡 ${e.kongWang.join("")||"—"} 驿马 ${e.ma.zhi||"—"}</span>
|
|
1636
1648
|
</div>
|
|
1637
|
-
<div class="mp-qm-grid">${
|
|
1649
|
+
<div class="mp-qm-grid">${jt.map(l=>l.map(r).join("")).join("")}</div>
|
|
1638
1650
|
<div class="mp-qm-legend">上=九星 中=天盘干/八门 下=地盘干/宫号 角落=八神</div>
|
|
1639
1651
|
<div class="mp-qm-rules">${e.rules.map(l=>`<p>${l}</p>`).join("")}</div>
|
|
1640
|
-
</div>`},
|
|
1652
|
+
</div>`},n.ziweiHepanHTML=function(e){const i=(o,c)=>`<div class="mp-hp-side">
|
|
1641
1653
|
<div class="mp-hp-who">${c}</div>
|
|
1642
1654
|
<div class="mp-hp-gz">命宫 ${o.soul.branch} 夫妻 ${o.soul.branch,""}${o.spouseStars.length,""}</div>
|
|
1643
1655
|
<div class="mp-hp-kv"><span>命宫主星</span><b>${o.soulStars.join("、")||"无正曜"}</b></div>
|
|
@@ -1648,7 +1660,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1648
1660
|
</div>`,r=e.dimensions.map(o=>`<div class="mp-hp-dim">
|
|
1649
1661
|
<div class="mp-hp-dimh"><span>${o.label}</span><b class="${o.score>=10?"good":o.score<0?"bad":""}">${o.score>=0?"+":""}${o.score}</b></div>
|
|
1650
1662
|
<div class="mp-hp-dimt">${o.text}</div>
|
|
1651
|
-
</div>`).join(""),l=o=>(e.interactions||[]).filter(c=>c.who===o).map(c=>`<li><b class="m-${c.mutagen}">${c.mutagen}</b>${c.star}:本命${c.ownPalace} → 对方${c.landingPalace||"盘外"}${c.strong?"<i>(强)</i>":""}</li>`).join("");return
|
|
1663
|
+
</div>`).join(""),l=o=>(e.interactions||[]).filter(c=>c.who===o).map(c=>`<li><b class="m-${c.mutagen}">${c.mutagen}</b>${c.star}:本命${c.ownPalace} → 对方${c.landingPalace||"盘外"}${c.strong?"<i>(强)</i>":""}</li>`).join("");return n.briefHTML(e)+`<div class="pp mp-hp">
|
|
1652
1664
|
<div class="mp-hp-head"><b>${e.score.level}</b><span>${e.score.total}/100 紫微合盘</span></div>
|
|
1653
1665
|
<div class="mp-hp-sides">${i(e.a,"你")}${i(e.b,"对方")}</div>
|
|
1654
1666
|
<div class="mp-hp-dims">${r}</div>
|
|
@@ -1656,38 +1668,38 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1656
1668
|
<div><div class="mp-hp-ith">你的四化 落在对方</div><ul>${l("你")||"<li>无</li>"}</ul></div>
|
|
1657
1669
|
<div><div class="mp-hp-ith">对方的四化 落在你</div><ul>${l("对方")||"<li>无</li>"}</ul></div>
|
|
1658
1670
|
</div>
|
|
1659
|
-
${
|
|
1671
|
+
${tt(e.triple)}
|
|
1660
1672
|
<div class="mp-hp-notes">${e.notes.map(o=>`<p>${o}</p>`).join("")}</div>
|
|
1661
|
-
</div>`},
|
|
1673
|
+
</div>`},n.curveHTML=function(e){const i=e&&e.dayun&&Array.isArray(e.dayun.list)?e.dayun.list:[],r=e&&Array.isArray(e.liunian)?e.liunian:[];if(i.length<2)return"";const l=y=>typeof y=="number"&&isFinite(y)?y:0,o=y=>y.luck?l(y.luck.score):0,c=4.2,d=-2.2,m=l(e.dayun.startAge&&e.dayun.startAge.years),u=i.length?i[i.length-1].startAge+10:m+80,f=r.map(y=>l(y.age)).filter(y=>y>0),x=Math.min(m,...f.length?f:[m]),E=Math.max(u,...f.length?f:[u]),S=Math.max(1,E-x),L=640,j=190,M={t:14,r:16,b:26,l:30},J=L-M.l-M.r,P=j-M.t-M.b,w=y=>M.l+(y-x)/S*J,z=y=>M.t+P-(Math.max(d,Math.min(c,y))-d)/(c-d)*P,F=[{from:1.2,to:c,cls:"b-good"},{from:.55,to:1.2,cls:"b-good"},{from:-.8,to:.55,cls:"b-flat"},{from:-1.45,to:-.8,cls:"b-bad"},{from:d,to:-1.45,cls:"b-bad"}].map(y=>`<rect class="cv-band ${y.cls}" x="${M.l}" y="${z(y.to).toFixed(1)}" width="${J}" height="${(z(y.from)-z(y.to)).toFixed(1)}"/>`).join(""),pe=10/S*J,$=[];i.forEach((y,le)=>{const ne=l(y.startAge),be=o(y),we=Math.max(M.l,w(ne)),ke=Math.min(M.l+J,w(ne+10));$.push(`${we.toFixed(1)},${z(be).toFixed(1)}`),$.push(`${ke.toFixed(1)},${z(be).toFixed(1)}`)});const me=$.length?`<polyline class="cv-dy" points="${$.join(" ")}"/>`:"",k=$.length?`<polygon class="cv-dyfill" points="${M.l},${(M.t+P).toFixed(1)} ${$.join(" ")} ${(M.l+J).toFixed(1)},${(M.t+P).toFixed(1)}"/>`:"",H=r.filter(y=>y.luck&&typeof y.luck.score=="number").map(y=>({x:w(l(y.age)),y:z(l(y.luck.score)),y0:l(y.year),gz:y.ganzhi,tier:y.luck.tier,v:l(y.luck.score),age:l(y.age)})),ee=H.length>1?`<polyline class="cv-ln" points="${H.map(y=>`${y.x.toFixed(1)},${y.y.toFixed(1)}`).join(" ")}"/>`:"",$e={大吉:"var(--lu)",吉:"var(--lu)",平:"var(--muted)",忌:"var(--red)",大忌:"var(--red)"},ue=H.length?Math.min(...H.map(y=>y.y0)):null,de=H.map(y=>`<circle class="cv-dot${y.y0===ue?" now":""}" cx="${y.x.toFixed(1)}" cy="${y.y.toFixed(1)}" fill="${$e[y.tier]||"var(--muted)"}"><title>${a(`${y.y0}年(${y.age}岁)${y.gz} ${y.tier} ${y.v}`)}</title></circle>`).join(""),ge=`<line class="cv-ax zero" x1="${M.l}" y1="${z(0).toFixed(1)}" x2="${M.l+J}" y2="${z(0).toFixed(1)}"/><line class="cv-ax" x1="${M.l}" y1="${M.t}" x2="${M.l}" y2="${M.t+P}"/>`,Ke=S>60?10:5,Ye=[];for(let y=Math.ceil(x/Ke)*Ke;y<=E;y+=Ke)Ye.push(`<text class="cv-lbl age" x="${w(y).toFixed(1)}" y="${(M.t+P+13).toFixed(1)}" text-anchor="middle">${y}岁</text>`);const Ve=`<text class="cv-lbl" x="${(M.l-5).toFixed(1)}" y="${(z(2.4)+3).toFixed(1)}" text-anchor="end">吉</text><text class="cv-lbl" x="${(M.l-5).toFixed(1)}" y="${(z(0)+3).toFixed(1)}" text-anchor="end">平</text><text class="cv-lbl" x="${(M.l-5).toFixed(1)}" y="${(z(-1.8)+3).toFixed(1)}" text-anchor="end">忌</text>`,b=i.slice().sort((y,le)=>o(le)-o(y)),A=b[0],X=b[b.length-1],Y=A&&o(A)>.55?`<text class="cv-lbl" x="${w(l(A.startAge)+5).toFixed(1)}" y="${(z(o(A))-5).toFixed(1)}" text-anchor="middle">▲${A.startAge}岁 ${A.luck.tier}</text>`:"",ce=X&&o(X)<-.8?`<text class="cv-lbl" x="${w(l(X.startAge)+5).toFixed(1)}" y="${(z(o(X))+11).toFixed(1)}" text-anchor="middle">▼${X.startAge}岁 ${X.luck.tier}</text>`:"",re=`<div class="cv-legend">
|
|
1662
1674
|
<span><i style="background:var(--quan)"></i>大运(阶梯,一步十年)</span>
|
|
1663
1675
|
<span><i style="background:var(--ke)"></i>流年(逐年折线)</span>
|
|
1664
1676
|
<span>绿带=吉 灰带=平 红带=忌</span>
|
|
1665
|
-
</div>`,
|
|
1666
|
-
<div class="mp-curve-h"><b>人生运势曲线</b><span>${
|
|
1667
|
-
<svg viewBox="0 0 ${
|
|
1668
|
-
${
|
|
1677
|
+
</div>`,h=`<div class="cv-tip">曲线只呈现引擎已给出的行运评分(${d} ~ ${c}),不预测具体事件;档位与依据见下方「大运 / 流年」各节。悬停看逐年详情。</div>`;return`<div class="mp-curve">
|
|
1678
|
+
<div class="mp-curve-h"><b>人生运势曲线</b><span>${x}–${E} 岁 ${e.dayun.rule},${m} 岁起运${e.dayun.jiao&&e.dayun.jiao.at?`,交运 ${e.dayun.jiao.at}`:""}</span></div>
|
|
1679
|
+
<svg viewBox="0 0 ${L} ${j}" role="img" aria-label="人生运势曲线:${x} 到 ${E} 岁的大运与流年评分走势">
|
|
1680
|
+
${F}${ge}${k}${me}${ee}${de}${Ye.join("")}${Ve}${Y}${ce}
|
|
1669
1681
|
</svg>
|
|
1670
|
-
${re}${
|
|
1671
|
-
</div>`},
|
|
1672
|
-
<svg viewBox="0 0 ${o} ${c}" role="img" aria-label="人生K线:1 到 ${
|
|
1682
|
+
${re}${h}
|
|
1683
|
+
</div>`},n.trendChart=function(e){const i=e&&Array.isArray(e.points)?e.points:[];if(i.length<2)return"";const r=e&&Array.isArray(e.segments)?e.segments:[],l=A=>typeof A=="number"&&isFinite(A)?A:0,o=720,c=322,d={t:34,r:46,b:66,l:36},m=o-d.l-d.r,u=c-d.t-d.b,f=i.length,x=m/f,E=A=>d.l+(A+.5)*x,S=A=>d.t+u-Math.max(0,Math.min(100,A))/100*u,L=Math.max(1.1,Math.min(10,x*.62)),j=A=>l(A.score),M=d.t+u,J=M+20,P=22,z=`klclip${(()=>{let A=2166136261;const X=Y=>{const ce=String(Y??"");for(let re=0;re<ce.length;re++)A^=ce.charCodeAt(re),A=Math.imul(A,16777619)};X(f),X(i[0]&&i[0].age),X(i[f-1]&&i[f-1].age);for(const Y of i)X(Y&&Y.score);return(A>>>0).toString(36)})()}`,ae=r.map((A,X)=>{const Y=Math.max(0,A.startAge-1),ce=Math.min(f-1,A.endAge-1);if(ce<Y)return"";const re=d.l+Y*x,h=Math.max(.6,(ce-Y+1)*x),le=X%2===1?`<rect class="kl-band" x="${re.toFixed(1)}" y="${d.t}" width="${h.toFixed(1)}" height="${u}"/><rect class="kl-stripband" x="${re.toFixed(1)}" y="${J}" width="${h.toFixed(1)}" height="${P}"/>`:"",ne=X===0?"":`<line class="kl-segline" x1="${re.toFixed(1)}" y1="${d.t}" x2="${re.toFixed(1)}" y2="${M}"/>`,be=Math.min(Math.max(d.l+(Y+ce+1)/2*x,d.l+22),d.l+m-22);return le+ne+`<text class="kl-seg" x="${be.toFixed(1)}" y="${(J+15).toFixed(1)}" text-anchor="middle">${a(A.ganZhi)}</text>`}).join(""),F=[0,25,50,75,100].map(A=>`<line class="kl-grid${A===50?" mid":""}" x1="${d.l}" y1="${S(A).toFixed(1)}" x2="${d.l+m}" y2="${S(A).toFixed(1)}"/><text class="kl-lbl" x="${d.l-6}" y="${(S(A)+3).toFixed(1)}" text-anchor="end">${A}</text>`).join(""),pe=i.map((A,X)=>{const Y=A.kline||{},ce=l(Y.open),re=l(Y.close),h=Math.min(100,l(Y.high)),y=Math.max(0,l(Y.low)),le=re>=ce,ne=S(ce),be=S(re),we=Math.min(ne,be),ke=Math.max(.8,Math.abs(ne-be)),ct=E(X),mt=`${A.age}岁(${A.year}年 ${A.ganZhi})${re}分${A.dayunGanZhi?` · ${A.dayunGanZhi}运`:""}`;return`<g class="kl-c${le?" up":" down"}"><title>${a(mt)}</title><line x1="${ct.toFixed(2)}" y1="${S(h).toFixed(1)}" x2="${ct.toFixed(2)}" y2="${S(y).toFixed(1)}"/><rect x="${(ct-L/2).toFixed(2)}" y="${we.toFixed(1)}" width="${L.toFixed(2)}" height="${ke.toFixed(1)}" rx="0.7"/></g>`}).join(""),$=A=>{const X=[];for(let Y=0;Y<f;Y++){if(Y+1<A)continue;let ce=0;for(let re=Y+1-A;re<=Y;re++)ce+=j(i[re]);X.push({i:Y,v:ce/A})}return X},me=A=>$(A).map((X,Y)=>`${Y?"L":"M"}${E(X.i).toFixed(1)} ${S(X.v).toFixed(1)}`).join(" "),k=(A,X)=>{const Y=$(A);if(!Y.length)return"";const ce=Y[Y.length-1];return{cls:X,y:S(ce.v),text:`<text class="kl-ma-lbl ${X}" x="${d.l+m+5}" y="${S(ce.v).toFixed(1)}" text-anchor="start">${ce.v.toFixed(0)}</text>`}},H=k(10,"m10"),ee=k(5,"m5"),$e=(()=>{if(!ee||!H)return`${H?H.text:""}${ee?ee.text:""}`;let A=ee.y,X=H.y;if(Math.abs(A-X)<10){const Y=Math.min(A,X),ce=Math.max(A,X);A=Y-6,X=ce+6}return`<text class="kl-ma-lbl m10" x="${d.l+m+5}" y="${X.toFixed(1)}" text-anchor="start">${$(10).slice(-1)[0].v.toFixed(0)}</text><text class="kl-ma-lbl m5" x="${d.l+m+5}" y="${A.toFixed(1)}" text-anchor="start">${$(5).slice(-1)[0].v.toFixed(0)}</text>`})();let ue=i[0],de=i[0];for(const A of i)j(A)>j(ue)&&(ue=A),j(A)<j(de)&&(de=A);const ge=(A,X,Y)=>{const ce=i.indexOf(A),re=E(ce),h=S(j(A)),y=Math.min(Math.max(re,d.l+26),d.l+m-26),le=X==="hi"?h-8<d.t+6?14:Y:h+12>d.t+u-2?-8:Y;return`<g class="kl-mark ${X}"><circle cx="${re.toFixed(1)}" cy="${h.toFixed(1)}" r="2"/><circle class="ring" cx="${re.toFixed(1)}" cy="${h.toFixed(1)}" r="4.6"/><text x="${y.toFixed(1)}" y="${(h+le).toFixed(1)}" text-anchor="middle">${A.age}岁 ${j(A)}</text></g>`},Ke=f>60?10:5,Ye=i.filter(A=>A.age%Ke===0).map(A=>`<text class="kl-lbl age" x="${E(i.indexOf(A)).toFixed(1)}" y="${(M+14).toFixed(1)}" text-anchor="middle">${A.age}</text>`).join(""),Ve=`<text class="kl-lbl axis" x="${d.l}" y="${(c-6).toFixed(1)}">年龄(岁)</text><text class="kl-lbl axis" x="${d.l+m}" y="${(c-6).toFixed(1)}" text-anchor="end">每岁一分 · 满分 100</text>`;return`<div class="mp-kline-fig">
|
|
1684
|
+
<svg viewBox="0 0 ${o} ${c}" role="img" aria-label="人生K线:1 到 ${f} 岁的逐年评分蜡烛图">
|
|
1673
1685
|
<defs><clipPath id="${z}"><rect x="${d.l}" y="${d.t}" width="${m}" height="${u}"/></clipPath></defs>
|
|
1674
|
-
${
|
|
1686
|
+
${ae}${F}
|
|
1675
1687
|
<g clip-path="url(#${z})">
|
|
1676
|
-
${
|
|
1677
|
-
<path class="kl-ma m10" d="${
|
|
1688
|
+
${pe}
|
|
1689
|
+
<path class="kl-ma m10" d="${me(10)}"/><path class="kl-ma m5" d="${me(5)}"/>
|
|
1678
1690
|
</g>
|
|
1679
1691
|
${$e}
|
|
1680
|
-
${
|
|
1681
|
-
${
|
|
1682
|
-
</svg><div class="kl-legend"><span><i class="up"></i>阳线:比上一岁高</span><span><i class="down"></i>阴线:比上一岁低</span><span><i class="m5"></i>5 年均线</span><span><i class="m10"></i>10 年均线</span><span>虚线=大运交界</span></div></div>`},
|
|
1692
|
+
${ge(ue,"hi",-8)}${ge(de,"lo",12)}
|
|
1693
|
+
${Ye}${Ve}
|
|
1694
|
+
</svg><div class="kl-legend"><span><i class="up"></i>阳线:比上一岁高</span><span><i class="down"></i>阴线:比上一岁低</span><span><i class="m5"></i>5 年均线</span><span><i class="m10"></i>10 年均线</span><span>虚线=大运交界</span></div></div>`},n.trendHTML=function(e,i){if(!e)return"";const r=!(i&&i.brief===!1),l=n.trendChart(e);if(!l)return n.quickHTML(e);const o=Array.isArray(e.segments)?e.segments:[],c=e.highlights&&typeof e.highlights=="object"?e.highlights:{},d=e.meta||{},m=d.strength||{},u=o.map(F=>`<span class="kl-chip">${a(F.ganZhi)}<em>${F.startAge}–${F.endAge}</em></span>`).join(""),f=(Array.isArray(c.best)?c.best:[]).map(F=>`<div class="kl-hl hi">${a(F)}</div>`).join(""),x=(Array.isArray(c.worst)?c.worst:[]).map(F=>`<div class="kl-hl lo">${a(F)}</div>`).join(""),E=d.boundaryNote?`<div class="mp-kline-note">${a(d.boundaryNote)}</div>`:c.suppressed?`<div class="mp-kline-note">${a(c.suppressed)}</div>`:"",S=Array.isArray(e.points)?e.points:[],L=F=>typeof F.score=="number"&&isFinite(F.score)?F.score:0,j=S.map(L),M=j.length?j.reduce((F,pe)=>F+pe,0)/j.length:0,J=j.length?Math.max(...j)-Math.min(...j):0,P=o.map(F=>{const pe=S.filter($=>$.age>=F.startAge&&$.age<=F.endAge).map(L);return{ganZhi:F.ganZhi,v:pe.length?pe.reduce(($,me)=>$+me,0)/pe.length:0}}).filter(F=>F.v>0).sort((F,pe)=>pe.v-F.v),w=!!(m.boundary||c.suppressed),z=[`<span><em>全段均值</em><b>${M.toFixed(0)}</b></span>`];!w&&P.length&&(z.push(`<span><em>最好大运</em><b class="hi">${a(P[0].ganZhi)} ${P[0].v.toFixed(0)}</b></span>`),z.push(`<span><em>最差大运</em><b class="lo">${a(P[P.length-1].ganZhi)} ${P[P.length-1].v.toFixed(0)}</b></span>`)),z.push(`<span><em>波动幅度</em><b>${J.toFixed(0)}</b></span>`);const ae=`<div class="kl-stats">${z.join("")}</div>`;return(r?n.briefHTML(e):"")+`<section class="mp-kline" aria-label="人生K线结果">
|
|
1683
1695
|
<div class="mp-kline-h"><b>人生 K 线</b><span>${a(d.birth||"")} 日主 ${a(d.dayMaster||"")} ${a(m.level||"")}${m.score?`(${m.score})`:""}</span></div>
|
|
1684
1696
|
${l}
|
|
1685
|
-
${
|
|
1697
|
+
${ae}
|
|
1686
1698
|
${u?`<div class="kl-segs">${u}</div>`:""}
|
|
1687
|
-
${
|
|
1688
|
-
${
|
|
1699
|
+
${f||x?`<div class="kl-hls">${f}${x}</div>`:""}
|
|
1700
|
+
${E}
|
|
1689
1701
|
<div class="mp-kline-tip">逐岁分数由大运与流年十神按固定表确定性计分(1–100),只表五行力量的顺逆,不预测具体事件;旺衰落在换档阈值附近时,不出高低年份结论。</div>
|
|
1690
|
-
</section>`},
|
|
1702
|
+
</section>`},n.chengguHTML=function(e){if(!e)return"";const i=e.weights||{},r=e.song||{},l=["year","month","day","hour"].map(m=>{const u=i[m]||{label:"",qian:0},f=String(u.label||"").split(" ")[0]||"",x=String(u.label||"").split(" ")[1]||"";return`<div class="cg-cell"><em>${a(f)}</em><b>${a(x)}</b></div>`}).join(""),o=String(r.text||""),c=o?o.replace(/[。]$/,"").split(";").map((m,u)=>`<span>${a(m)}${u===0?";":"。"}</span>`).join(""):"",d=e.verdict&&e.verdict.band?e.verdict.band:"";return`<section class="mp-cg" aria-label="称骨结果">
|
|
1691
1703
|
<div class="mp-cg-h"><b>称骨</b><span>${a(e.lunar&&e.lunar.text?e.lunar.text:"")}</span></div>
|
|
1692
1704
|
<div class="mp-cg-w">${l}</div>
|
|
1693
1705
|
<div class="mp-cg-tot"><em>骨重合计</em><b>${a(e.total&&e.total.label?e.total.label:"")}</b>${d?`<i>${a(d)}</i>`:""}</div>
|
|
@@ -1696,78 +1708,78 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1696
1708
|
<div class="mp-cg-plain"><em>释义</em>${a(r.plain||"")}</div></div>
|
|
1697
1709
|
${e.verdict&&e.verdict.text?`<div class="mp-cg-band"><em>分档</em>${a(e.verdict.text)}</div>`:""}
|
|
1698
1710
|
<div class="mp-cg-note">骨重与歌诀为通行本口径(各版本歌诀有异文,断句标点已统一);释义为白话自撰,只作字面直解,属民俗娱乐参考,不构成命运断言。</div>
|
|
1699
|
-
</section>`},
|
|
1700
|
-
${l("候选名",`姓 ${e.surname}(${e.gender})${
|
|
1701
|
-
<div class="mp-nm-cand">${
|
|
1702
|
-
<div class="mp-nm-note">${(e.notes||[]).map(
|
|
1703
|
-
</section>`}const o=(e.chars||[]).map(
|
|
1704
|
-
<div class="mp-nm-b"><div class="mp-nm-t">${r(
|
|
1705
|
-
<div class="mp-nm-m">${a(
|
|
1706
|
-
<div class="mp-nm-m">${a(e.bazi.basis||"")}</div>`:"",d=
|
|
1711
|
+
</section>`},n.nameHTML=function(e){if(!e)return"";const i={木:"wood",火:"fire",土:"earth",金:"metal",水:"water"},r=f=>f==="未收录"?'<span class="mp-nm-el">未收录</span>':`<span class="mp-nm-el wx-${i[f]||"earth"}">${a(f)}</span>`,l=(f,x)=>`<div class="mp-nm-h"><b>${a(f)}</b>${x?`<i>${a(x)}</i>`:""}</div>`;if(e.action==="generate"){const f=e.bazi&&e.bazi.favorable?e.bazi.favorable.join("、"):"",x=(e.candidates||[]).map(E=>{const S=E.wuge&&E.wuge.available?(()=>{const j=E.wuge.rows.filter(P=>P.level==="吉").length,M=E.wuge.rows.filter(P=>P.level==="凶").length;return`<span class="mp-nm-fit${M===0&&j>=4?" ok":M>=2?" no":""}" title="${a(E.wuge.summary)}">五格 ${j}/5 吉</span>`})():"",L=E.phonetics&&E.phonetics.available?`<span class="mp-nm-fit${E.phonetics.level==="拗口"?" no":E.phonetics.level==="顺口"?" ok":""}" title="${a((E.phonetics.issues||[]).map(j=>j.text).join(";"))}">${a(E.phonetics.level)}</span>`:"";return`<div class="mp-nm-c"><b>${a(E.name)}</b><span class="mp-nm-els">${E.chars.map(j=>r(j.element)).join("")}${S}${L}</span><em>${a(E.chars.map(j=>j.char+"·"+j.meaning).join(" "))}</em></div>`}).join("");return`<section class="mp-nm" aria-label="候选名">
|
|
1712
|
+
${l("候选名",`姓 ${e.surname}(${e.gender})${f?` 喜用 ${f}`:""}`)}
|
|
1713
|
+
<div class="mp-nm-cand">${x}</div>
|
|
1714
|
+
<div class="mp-nm-note">${(e.notes||[]).map(E=>"※ "+a(E)).join("<br>")}</div>
|
|
1715
|
+
</section>`}const o=(e.chars||[]).map(f=>{const x=f.favorable===!0?'<span class="mp-nm-fit ok">合喜用</span>':f.favorable===!1?'<span class="mp-nm-fit no">不合喜用</span>':'<span class="mp-nm-fit">不判</span>',E=f.source==="user"?"用户指定":f.source==="lib"?"字库":"未收录",S=f.suggest&&f.suggest.length?`<div class="mp-nm-sug"><b>可换</b>${f.suggest.map(L=>`<span class="wx-${i[L.element]||"earth"}">${a(L.char)}(${a(L.element)})</span>`).join("")}</div>`:"";return`<div class="mp-nm-row"><div class="mp-nm-ch">${a(f.char)}</div>
|
|
1716
|
+
<div class="mp-nm-b"><div class="mp-nm-t">${r(f.element)}<span>${a(E)}</span>${x}</div>
|
|
1717
|
+
<div class="mp-nm-m">${a(f.meaning)}</div>${S}</div></div>`}).join(""),c=e.bazi?`<div class="mp-nm-m">八字:${a(e.bazi.dayMaster&&e.bazi.dayMaster.stem?`${e.bazi.dayMaster.stem}(${e.bazi.dayMaster.element})`:String(e.bazi.dayMaster||""))} ${a(e.bazi.strength?`${e.bazi.strength.level}(${e.bazi.strength.score})`:"")} 喜用 ${a((e.bazi.favorable||[]).join("、"))}</div>
|
|
1718
|
+
<div class="mp-nm-m">${a(e.bazi.basis||"")}</div>`:"",d=f=>f==="吉"?"is-ok":f==="半吉"?"is-half":"is-bad",m=e.wuge&&e.wuge.available?`<div class="mp-nm-wu">
|
|
1707
1719
|
<div class="mp-nm-wu-h"><b>五格</b><i>康熙笔画 · 通行本 81 数理</i></div>
|
|
1708
|
-
<div class="mp-nm-wu-rows">${e.wuge.rows.map(
|
|
1709
|
-
<div class="mp-nm-m">笔画:${e.wuge.strokes.map(
|
|
1720
|
+
<div class="mp-nm-wu-rows">${e.wuge.rows.map(f=>`<div class="mp-nm-wu-c ${d(f.level)}"><em>${a(f.key)}</em><b>${f.strokes}</b><i>${a(`${f.level} · ${f.name}`)}</i></div>`).join("")}</div>
|
|
1721
|
+
<div class="mp-nm-m">笔画:${e.wuge.strokes.map(f=>`${a(f.char)}${f.strokes}${f.source==="user"?"(指定)":""}`).join(" + ")}</div>
|
|
1710
1722
|
<div class="mp-nm-m">三才:${a(e.wuge.sancai.text)}</div>
|
|
1711
|
-
</div>`:`<div class="mp-nm-wu"><div class="mp-nm-wu-h"><b>五格</b><i>这一版算不了</i></div><div class="mp-nm-m">${a(e.wuge?e.wuge.reason:"未算")}</div></div>`,u=e.phonetics&&e.phonetics.available?`<div class="mp-nm-ph"><b>音韵</b><span class="mp-nm-ph-lv${e.phonetics.level==="顺口"?" ok":e.phonetics.level==="拗口"?" bad":" warn"}">${a(e.phonetics.level)}</span><em>${a(e.phonetics.chars.map(
|
|
1723
|
+
</div>`:`<div class="mp-nm-wu"><div class="mp-nm-wu-h"><b>五格</b><i>这一版算不了</i></div><div class="mp-nm-m">${a(e.wuge?e.wuge.reason:"未算")}</div></div>`,u=e.phonetics&&e.phonetics.available?`<div class="mp-nm-ph"><b>音韵</b><span class="mp-nm-ph-lv${e.phonetics.level==="顺口"?" ok":e.phonetics.level==="拗口"?" bad":" warn"}">${a(e.phonetics.level)}</span><em>${a(e.phonetics.chars.map(f=>`${f.py}${f.tone}`).join(" "))} 声调 ${a(e.phonetics.tonePattern)}${(e.phonetics.alt||[]).length?` 又读 ${a(e.phonetics.alt.map(f=>`${f.char} ${f.py}${f.tone}`).join("、"))}`:""}</em>${(e.phonetics.issues||[]).map(f=>`<span class="mp-nm-ph-i">${a(f.text)}</span>`).join("")}</div>`:`<div class="mp-nm-ph"><b>音韵</b><em>${a(e.phonetics?e.phonetics.reason:"未算")}</em></div>`;return`<section class="mp-nm" aria-label="名字评估">
|
|
1712
1724
|
${l(e.fullName||"",`字库 ${e.stats&&e.stats.libSize?e.stats.libSize:""} 字${e.stats&&e.stats.unknown?` 未收录 ${e.stats.unknown}`:""}`)}
|
|
1713
1725
|
${o}
|
|
1714
1726
|
${c}
|
|
1715
1727
|
${m}
|
|
1716
1728
|
${u}
|
|
1717
1729
|
<div class="mp-nm-verd">${a(e.verdict||"")}</div>
|
|
1718
|
-
<div class="mp-nm-note">${(e.notes||[]).map(
|
|
1719
|
-
</section>`},
|
|
1730
|
+
<div class="mp-nm-note">${(e.notes||[]).map(f=>"※ "+a(f)).join("<br>")}</div>
|
|
1731
|
+
</section>`},n.briefHTML=function(e){return e&&e.brief?n.summaryHTML(e.brief):""},n.summaryHTML=function(e){if(!e||!e.lead)return"";const i=(e.sections||[]).map(o=>`<div class="mp-br-sec"><b>${a(o.h)}</b><p>${a(o.t)}</p></div>`).join(""),r=e.advice&&e.advice.length?`<div class="mp-br-adv"><b>可以试着做的</b><ul>${e.advice.map(o=>`<li>${a(o)}</li>`).join("")}</ul></div>`:"",l=e.chips&&e.chips.length?`<div class="mp-br-chips">${e.chips.map(o=>`<span>${a(o)}</span>`).join("")}</div>`:"";return`<section class="mp-br" aria-label="先说结论">
|
|
1720
1732
|
<div class="mp-br-h"><b>${a(e.title||"先看这一张")}</b>${l}</div>
|
|
1721
1733
|
<p class="mp-br-lead">${a(e.lead)}</p>
|
|
1722
1734
|
${i}
|
|
1723
1735
|
${r}
|
|
1724
1736
|
${e.caveat?`<p class="mp-br-cav">※ ${a(e.caveat)}</p>`:""}
|
|
1725
1737
|
${e.footer?`<p class="mp-br-foot">${a(e.footer)}</p>`:""}
|
|
1726
|
-
</section>`},
|
|
1738
|
+
</section>`},n.baziHTML=function(e){const i=[["year","年柱"],["month","月柱"],["day","日柱"],["hour","时柱"]].filter(([h])=>e.pillars[h]),r={year:"年",month:"月",day:"日",hour:"时"},l={木:"wood",火:"fire",土:"earth",金:"metal",水:"water"},o={比肩:"tg-bi",劫财:"tg-bi",食神:"tg-shi",伤官:"tg-shi",偏财:"tg-cai",正财:"tg-cai",七杀:"tg-guan",正官:"tg-guan",偏印:"tg-yin",正印:"tg-yin"},c=h=>`<span class="tg ${o[h]||""}">${h}</span>`,d=h=>`<span class="wx-${l[h]||"earth"}">${O(h)}${h}</span>`,m=h=>`<span class="ss-s ${h.luck||"neutral"}" title="${a(`${h.cat} · ${h.via}查${h.target} | ${h.rule}`)}">${h.name}</span>`,u=(h,y)=>`<tr><td class="bz-lbl">${h}</td>${i.map(([le])=>`<td data-c="${r[le]}">${y(e.pillars[le],le)}</td>`).join("")}</tr>`,f=`<thead><tr><th></th>${i.map(([h,y])=>`<th${h==="day"?' class="bz-hdr-day"':""}>${y}</th>`).join("")}</tr></thead>`,x={寅:"木",卯:"木",巳:"火",午:"火",申:"金",酉:"金",亥:"水",子:"水",辰:"土",戌:"土",丑:"土",未:"土"},E={木:"火",火:"土",土:"金",金:"水",水:"木"},S={木:"土",土:"水",水:"火",火:"金",金:"木"},L=x[e.pillars.month.branch]||"土",j=["木","火","土","金","水"],M=h=>h===L?"旺":E[L]===h?"相":E[h]===L?"休":S[h]===L?"囚":"死",J=`<tr><td class="bz-lbl">五行</td><td class="bz-wxs" colspan="${i.length}">${["旺","相","休","囚","死"].map(h=>{const y=j.find(le=>M(le)===h)||L;return`<i><b class="wx-${l[y]}">${y}</b><em>${h}</em></i>`}).join("")}</td></tr>`,P=[u("十神",(h,y)=>y==="day"?`<span class="bz-zhuri">${e.input.gender==="male"?"元男":"元女"}</span>`:h.stemTenGod?c(h.stemTenGod):'<span class="pp-dim">—</span>'),u("天干",h=>`<span class="bz-big ${"wx-"+l[h.stemElement]}">${h.stem}</span>`),u("地支",h=>`<span class="bz-big ${"wx-"+l[h.branchElement]}">${h.branch}</span>`),u("藏干",h=>h.hidden.map(y=>`<i class="bz-cg wx-${l[y.element]}">${y.stem}·${y.element}</i>`).join("")),u("支神",h=>h.hidden.map(y=>c(y.tenGod)).join("<br>")),u("纳音",h=>h.nayin),u("空亡",h=>`<span class="pp-dim">${h.kongwang.join("")}</span>`),u("地势",h=>h.dishi),u("自坐",h=>h.zizuo),u("神煞",h=>h.shenshaDetail&&h.shenshaDetail.length?`<span class="pp-ss">${h.shenshaDetail.map(m).join("")}</span>`:'<span class="pp-dim">—</span>'),J].join(""),w=Object.entries(e.wuxing).map(([h,y])=>`<span class="pp-chip wx-${l[h]}">${O(h)}${h} ${y}</span>`).join(""),z=e.frame||{},ae=h=>h==="大吉"||h==="吉"?"ok":h==="大忌"||h==="忌"?"warn":"",F=(h,y)=>y?`<div class="pp-sec"><div class="pp-sec-h">${h}</div>${y}</div>`:"",pe=z.geju&&z.geju.length?`
|
|
1727
1739
|
<div class="pp-tl">${z.primary?`主格 <b>${a(z.primary.name)}</b> ${a(z.primary.evidence)}`:""}</div>
|
|
1728
|
-
<div class="pp-chips">${z.geju.map(
|
|
1740
|
+
<div class="pp-chips">${z.geju.map(h=>{const y=h.status==="破格",le=h.status==="待定"||h.status==="假从",ne=`${h.evidence||""}${Array.isArray(h.breaks)&&h.breaks.length?`;破:${h.breaks.join(";")}`:""}`;return`<span class="pp-chip ${y?"broken":le?"warn":""}" title="${a(ne)}">${a(h.name)}<i class="pp-drel">${a(h.kind)}${h.status?`·${a(h.status)}`:""}</i></span>`}).join("")}</div>`:"",$=(()=>{const h=Array.isArray(z.yongshen&&z.yongshen.neutral)?z.yongshen.neutral:[],y=new Set(z.yongshen&&z.yongshen.neutralTenGods||[]);return`${(z.yongshen&&z.yongshen.avoidTenGods||[]).filter(ne=>!y.has(ne)).map(ne=>`<span class="pp-chip warn">${a(ne)}</span>`).join("")}${[...y].map(ne=>`<span class="pp-chip neu" title="局中分量近零,按中性偏忌看">${a(ne)}</span>`).join("")}${h.length?`<span class="pp-chip neu" title="忌神中全局不足 0.5 分的那几行;仍在忌里参与行运评分">中性偏忌 ${h.map(ne=>`${a(ne.element)} ${a(ne.weight)} 分`).join("、")}</span>`:""}`})(),me=z.yongshen?`
|
|
1729
1741
|
<div class="pp-tl">喜 ${z.yongshen.favor.map(d).join("")} 忌 ${z.yongshen.avoid.map(d).join("")} <span class="pp-dim">${a(z.yongshen.method)}</span></div>
|
|
1730
|
-
<div class="pp-chips">${z.yongshen.favorTenGods.map(
|
|
1731
|
-
${(z.yongshen.disputed||[]).length?`<div class="pp-tl pp-dim">有争议:${z.yongshen.disputed.map(
|
|
1732
|
-
<div class="pp-tl pp-dim">${a(z.yongshen.detail)}</div>`:"",k=e.climate||z.yongshen&&z.yongshen.climate||null,
|
|
1733
|
-
<div class="mp-qt-h"><b>穷通宝鉴</b><span>${a(
|
|
1734
|
-
<div class="mp-qt-y"><em>用神</em>${
|
|
1735
|
-
<div class="mp-qt-q" title="${a(
|
|
1742
|
+
<div class="pp-chips">${z.yongshen.favorTenGods.map(h=>`<span class="pp-chip ok">${a(h)}</span>`).join("")}${$}</div>
|
|
1743
|
+
${(z.yongshen.disputed||[]).length?`<div class="pp-tl pp-dim">有争议:${z.yongshen.disputed.map(h=>`${a(h.element)}(扶抑为${a(h.favorRole)}·${a(h.favorVerb)},${a(h.climate)}盘调候忌${a(h.element)})`).join("、")} 保留在喜用,不列入忌</div>`:""}
|
|
1744
|
+
<div class="pp-tl pp-dim">${a(z.yongshen.detail)}</div>`:"",k=e.climate||z.yongshen&&z.yongshen.climate||null,H=k?(()=>{const h=Math.max(2,Math.min(98,Math.round(((Number(k.temp)||0)+3)/6*100))),y=k.need?`<em>调候取</em><b>${a(k.need.stem+k.need.element)}</b>`:"<em>气候平和</em>",le=!!(z.yongshen&&Array.isArray(z.yongshen.disputed))&&z.yongshen.disputed.some(mt=>mt.element===k.avoidElement),ne=k.need?`<em>忌</em><b>${a(k.avoidElement)}</b>${le?'<span class="pp-dim">(有争议)</span>':""}`:"",be=(k.evidence||[]).length?`<em>依据</em><span>${a(k.evidence.join("、"))}</span>`:"",we=k.priority==="调候优先"?'<span class="mp-cli-p">调候优先</span>':'<span class="mp-cli-p">扶抑为主</span>',ke=e.frame&&e.frame.yongshen&&e.frame.yongshen.qt,ct=ke?`<div class="mp-qt">
|
|
1745
|
+
<div class="mp-qt-h"><b>穷通宝鉴</b><span>${a(ke.label)}</span></div>
|
|
1746
|
+
<div class="mp-qt-y"><em>用神</em>${ke.yong.map((mt,ja)=>`<b class="${ja===0?"first":""}">${a(mt)}</b>`).join("")}<em>首取 ${a(ke.primary)}</em></div>
|
|
1747
|
+
<div class="mp-qt-q" title="${a(ke.quote)}">「${a(ke.quote)}」<span>第 ${ke.chapter} 章${ke.truncated?" · 首段更长,摘句下略":""}${ke.note?" · "+a(ke.note):""}</span></div>
|
|
1736
1748
|
</div>`:"";return`<section class="mp-cli" aria-label="寒暖燥湿">
|
|
1737
1749
|
<div class="mp-cli-h"><b>寒暖燥湿</b><span class="mp-cli-k">${a(k.label||"")}</span>${we}</div>
|
|
1738
|
-
<div class="mp-cli-bar" title="寒 ← → 热"><i style="left:${
|
|
1750
|
+
<div class="mp-cli-bar" title="寒 ← → 热"><i style="left:${h}%"></i></div>
|
|
1739
1751
|
<div class="mp-cli-axis"><span>寒</span><span>平</span><span>热</span></div>
|
|
1740
|
-
<div class="mp-cli-row">${
|
|
1752
|
+
<div class="mp-cli-row">${y}${ne}${be}</div>
|
|
1741
1753
|
<div class="mp-cli-narr">${a(k.narration||"")}</div>
|
|
1742
|
-
${
|
|
1743
|
-
</section>`})():"",
|
|
1754
|
+
${ct}
|
|
1755
|
+
</section>`})():"",ee=z.godStats?`<div class="pp-chips">${Object.entries(z.godStats.groups).map(([h,y])=>`<span class="pp-chip">${h} ${y}</span>`).join("")}</div>`:"",$e=e.dayun.list.map(h=>{const y=h.luck||null;return`<span class="pp-chip ${y?ae(y.tier):""}" title="${a(`${h.fromDate?`${h.fromDate} 交运;`:""}${y?`${y.tier} ${y.score}|${(y.reasons||[]).join(";")}`:""}`)}">${h.startAge} ${h.ganzhi}${h.relations&&h.relations.length?` <i class="pp-drel">${h.relations.join("")}</i>`:""}${y?` ${y.tier}`:""}</span>`}).join(""),ue=e.liunian&&e.liunian.length?`<div class="pp-chips">${e.liunian.slice(0,8).map(h=>{const y=h.luck||null,le=h.suiyun&&Array.isArray(h.suiyun.signals)?h.suiyun.signals:[],ne=le.length?`|${le.map(be=>be.detail).join(";")}`:"";return`<span class="pp-chip ${y?ae(y.tier):""}" title="${a(y?`${y.tier} ${y.score}|${(y.reasons||[]).join(";")}${ne}`:ne.replace(/^|/,""))}">${h.year} ${h.ganzhi}${y?` ${y.tier}`:""}</span>`}).join("")}</div>`:"",de=(e.liunian||[]).filter(h=>h.suiyun&&Array.isArray(h.suiyun.signals)&&h.suiyun.signals.length),ge=e.suiyunClassic,Ke=ge?`<div class="pp-dim pp-sy-src" title="${a(ge.plain||"")}">《${a(ge.bookName||"")}·${a(ge.chapter||"")}》「${a(ge.quote||"")}」</div>`:"",Ye=de.length?`<div class="pp-tl pp-dim">岁运提示(只标干支变动,不判吉凶)</div><div class="pp-chips">${de.map(h=>`<span class="pp-chip" title="${a(`${h.suiyun.signals.map(y=>y.detail).join(";")}|${h.suiyun.note||""}`)}">${h.year} ${a(h.suiyun.signals.map(y=>`${y.type}${(y.type.startsWith("流年")||y.type.startsWith("大运"))&&y.target?`·${y.target}`:""}`).join("/"))}</span>`).join("")}</div>${Ke}`:"",Ve=e.strength?`<div class="pp-str">日主强弱:<b>${e.strength.level}</b>${e.strength.score} <span class="pp-dim">${e.strength.detail}</span></div>`:"",b=e.strength&&e.strength.branchStructure,A=b?(()=>{const h=b.branches.map(we=>`${a(we.label)}${a(we.branch)}<i class="pp-drel">·${a(we.camp)}</i>${b.placeholderHour&&we.key==="hour"?'<span class="pp-dim">占位</span>':""}`).join(" "),y=b.odd&&b.odd.length?`<span class="pp-st-odd">异类 ${b.odd.map(we=>`${a(we.label)}${a(we.branch)}(${we.weight}分)`).join("、")}</span>`:'<span class="pp-st-odd">无异类</span>',le=b.congProb!=null?` 从格 ${a(b.congRange)}`:" 不套从格概率",ne=b.balance||{},be=ne.branch?` 支 ${ne.branch.A}:${ne.branch.B} 合干 ${ne.total?`${ne.total.A}:${ne.total.B}`:"—"}`:"";return`<div class="pp-struct" title="${a(`${b.method};${b.note}`)}"><span class="pp-st-code">${a(b.code)}</span>${h} ${y}${le}${be}<span class="pp-dim"> 静态结构,只作标注,不改上面的旺衰评分</span></div>`})():"",X=e.relations&&Array.isArray(e.relations.anhe)?e.relations.anhe:[],Y=X.length?`<div class="pp-anhe" title="${a(e.relations.anheNote||"")}"><b>暗合</b>${X.map(h=>a(h)).join(" ")}<span class="pp-dim"> 另列,不并入上面的合冲刑害;${X.length===1?"只一对,按口径可忽略":`共 ${X.length} 对`}</span></div>`:"",ce=e.shensha&&e.shensha.groups||[],re=ce.length?`
|
|
1744
1756
|
<div class="pp-ssx">
|
|
1745
|
-
<div class="ssx-h"><b>神煞全览</b><span>共 ${e.shensha.count} 见 · ${
|
|
1746
|
-
${
|
|
1757
|
+
<div class="ssx-h"><b>神煞全览</b><span>共 ${e.shensha.count} 见 · ${ce.length} 类 · 悬停看查法</span></div>
|
|
1758
|
+
${ce.map(h=>`<div class="pp-ssg"><span class="ssg-gt">${h.cat}</span><span class="ssg-gi">${h.items.map(y=>`<span class="pp-ssi ${y.luck||"neutral"}" title="${a(`${y.via}查${y.target} | ${y.rule}`)}">${y.name}<em>${y.pillars.map(le=>r[le]||"").join("")}</em></span>`).join("")}</span></div>`).join("")}
|
|
1747
1759
|
<div class="ssx-h" style="border-top:none;padding-top:4px;margin-top:4px">神煞只作参考,吉凶仍须看格局、旺衰与行运。</div>
|
|
1748
|
-
</div>`:"";return
|
|
1749
|
-
<table class="pp-bz">${
|
|
1760
|
+
</div>`:"";return n.briefHTML(e)+`<div class="pp" style="padding:12px">
|
|
1761
|
+
<table class="pp-bz">${f}<tbody>${P}</tbody></table>
|
|
1750
1762
|
${e.hourUnknown?'<div class="pp-warn" role="note">时柱暂缺:只排年/月/日三柱,起运与交运按日估算。时柱按正午暂算,涉及时柱的结论仅供参考。</div>':""}
|
|
1751
1763
|
<div class="pp-rel"><div><b>天干</b>${e.relations&&e.relations.stems.length?e.relations.stems.join(" · "):"—"}</div>
|
|
1752
1764
|
<div><b>地支</b>${e.relations&&e.relations.branches.length?e.relations.branches.join(" · "):"—"}</div></div>
|
|
1753
|
-
${
|
|
1754
|
-
${
|
|
1755
|
-
${
|
|
1756
|
-
${
|
|
1757
|
-
${
|
|
1758
|
-
${
|
|
1765
|
+
${Ve}
|
|
1766
|
+
${A}
|
|
1767
|
+
${Y}
|
|
1768
|
+
${F("格局",pe)}
|
|
1769
|
+
${F("用神",me)}
|
|
1770
|
+
${H}
|
|
1759
1771
|
${Array.isArray(e.classics)&&e.classics.length?`<section class="mp-cl" aria-label="古籍原文">
|
|
1760
1772
|
<div class="mp-cl-h"><b>古籍原文</b><span>照录通行本,释义为白话自撰</span></div>
|
|
1761
|
-
${e.classics.map(
|
|
1762
|
-
<div class="mp-cl-t"><b>${a(({ziping:"子平真诠",ditian:"滴天髓",sanming:"三命通会"}[
|
|
1763
|
-
<div class="mp-cl-q">「${a(
|
|
1764
|
-
<div class="mp-cl-p">${a(
|
|
1773
|
+
${e.classics.map(h=>`<div class="mp-cl-e">
|
|
1774
|
+
<div class="mp-cl-t"><b>${a(({ziping:"子平真诠",ditian:"滴天髓",sanming:"三命通会"}[h.book]||h.book)+"·"+h.chapter)}</b></div>
|
|
1775
|
+
<div class="mp-cl-q">「${a(h.quote)}」</div>
|
|
1776
|
+
<div class="mp-cl-p">${a(h.plain)}</div>
|
|
1765
1777
|
</div>`).join("")}
|
|
1766
1778
|
</section>`:""}
|
|
1767
|
-
${
|
|
1768
|
-
${
|
|
1769
|
-
${ue?
|
|
1770
|
-
${e.palaces?
|
|
1779
|
+
${F("五行与十神",`<div class="pp-chips">${w}</div>${ee}`)}
|
|
1780
|
+
${F("大运",`${n.curveHTML(e)}<div class="pp-chips">${$e}</div>`)}
|
|
1781
|
+
${ue?F("流年",ue+Ye):""}
|
|
1782
|
+
${e.palaces?F("胎命身",`<div class="pp-chips">
|
|
1771
1783
|
<span class="pp-chip" title="${a(e.palaces.taiyuan.note)}">胎元 ${a(e.palaces.taiyuan.ganzhi)}</span>
|
|
1772
1784
|
${e.palaces.taixi?`<span class="pp-chip" title="${a(e.palaces.taixi.note)}">胎息 ${a(e.palaces.taixi.ganzhi)}</span>`:""}
|
|
1773
1785
|
${e.palaces.minggong?`<span class="pp-chip" title="${a(e.palaces.minggong.note)}">命宫 ${a(e.palaces.minggong.ganzhi)}</span>`:""}
|
|
@@ -1776,31 +1788,31 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1776
1788
|
</div>`):""}
|
|
1777
1789
|
${re}
|
|
1778
1790
|
<div style="margin-top:8px;font-size:12px;color:var(--muted)">上一节 ${e.jieqi.previous.name} ${e.jieqi.previous.time} 下一节 ${e.jieqi.next.name} ${e.jieqi.next.time} ${e.dayun.rule},${e.dayun.startAge.years}岁起运${e.dayun.jiao&&e.dayun.jiao.at?`(交运 ${e.dayun.jiao.at},${e.dayun.jiao.frame})`:""}${e.dayun.startAgeExact&&Number.isInteger(e.dayun.startAgeExact.years)?` 精确 ${e.dayun.startAgeExact.years}年${e.dayun.startAgeExact.months}月${e.dayun.startAgeExact.days}天${e.dayun.startAgeExact.hours}时(截断到日时;上面是四舍五入到月)`:""}</div>
|
|
1779
|
-
</div>`};const
|
|
1791
|
+
</div>`};const Dt={natal:"命盘解析",divination:"卦象解析",card:"牌阵解析"},ta={同向:"good",有张力:"watch",互补:"alt"},Pt=e=>`<div class="mp-cross">${e.map(i=>{const r=ta[i.stance]||"plain";return`<div class="mp-cross-row">
|
|
1780
1792
|
<div class="mp-cross-h"><span class="mp-cross-l">${a(i.label)}</span><span class="mp-cross-tag t-${r}">${a(i.stance||"—")}</span></div>
|
|
1781
1793
|
<div class="mp-cross-b">
|
|
1782
1794
|
<div class="mp-cross-cell"><b>八字</b><span>${a(i.bazi||"—")}</span></div>
|
|
1783
1795
|
<div class="mp-cross-cell"><b>紫微</b><span>${a(i.ziwei||"—")}</span></div>
|
|
1784
1796
|
</div>
|
|
1785
1797
|
${i.note?`<div class="mp-cross-note">${a(i.note)}</div>`:""}
|
|
1786
|
-
</div>`}).join("")}</div>`;
|
|
1787
|
-
<div class="mp-it-dh"><span class="mp-it-dno">${
|
|
1798
|
+
</div>`}).join("")}</div>`;n.interpretHTML=function(e,i){if(!e||!(e.dimensions&&e.dimensions.length||e.sections&&e.sections.length)&&!e.error&&!e.answer)return"";const l=!!(i&&i.folded);let o=-1;(e.dimensions||[]).forEach(($,me)=>{$.knowledge&&$.knowledge.length&&(o=me)});const c=(e.dimensions||[]).map(($,me)=>`<div class="mp-it-dim${$.focused?" focus":""}">
|
|
1799
|
+
<div class="mp-it-dh"><span class="mp-it-dno">${me+1}</span><span class="mp-it-dlabel">${a($.label)}</span>${$.focused?'<span class="mp-it-focus">最贴近你的问题</span>':""}${$.confidence?`<span class="mp-it-conf c-${a($.confidence)}">置信度 ${a($.confidence)}</span>`:""}</div>
|
|
1788
1800
|
${$.plain?`<div class="mp-it-dplain">${a($.plain)}</div>`:""}
|
|
1789
1801
|
<div class="mp-it-dtext">${a($.text)}</div>
|
|
1790
1802
|
${$.evidence&&$.evidence.length?`<details class="mp-it-ev"><summary>依据 · ${a($.evidence.length)} 条盘面事实</summary><div class="mp-it-ev-body">${$.evidence.map(k=>`<span class="mp-it-ev-item">${a(k)}</span>`).join("")}<span class="mp-it-ev-tech">技法:${a(e.technique||e.systemLabel||"")}</span></div></details>`:""}
|
|
1791
|
-
${$.knowledge&&$.knowledge.length?`<div class="mp-it-know">${$.knowledge.map(k=>`<div class="know-row"><span class="know-status ${k.status}">${a(k.statusLabel)}</span><span class="know-body"><b>${a(k.gist)}</b>${a(k.detail)}${k.source?`<i>出处:${a(k.source)}</i>`:""}${k.note?`<em>注:${a(k.note)}</em>`:""}</span></div>`).join("")}${
|
|
1803
|
+
${$.knowledge&&$.knowledge.length?`<div class="mp-it-know">${$.knowledge.map(k=>`<div class="know-row"><span class="know-status ${k.status}">${a(k.statusLabel)}</span><span class="know-body"><b>${a(k.gist)}</b>${a(k.detail)}${k.source?`<i>出处:${a(k.source)}</i>`:""}${k.note?`<em>注:${a(k.note)}</em>`:""}</span></div>`).join("")}${me===o&&e.knowledgeNote?`<div class="know-disc">${a(e.knowledgeNote)}</div>`:""}</div>`:""}
|
|
1792
1804
|
${$.advice?`<div class="mp-it-adv"><b>建议</b>${a($.advice)}</div>`:""}
|
|
1793
1805
|
</div>`).join(""),d=e.outline&&e.outline.length?`<div class="mp-outline"><div class="mp-outline-h">一页读懂</div>${e.outline.map($=>`<div class="mp-outline-row"><b>${a($.label)}</b><span>${a($.text)}</span></div>`).join("")}</div>`:"",m=e.sections&&e.sections.length?`<nav class="mp-toc" aria-label="报告目录">${e.sections.map($=>`<a href="#mp-sec-${a($.key)}">${a($.label)}</a>`).join("")}</nav>`:"",u=e.tables&&e.tables.length?`<div class="mp-tables">${e.tables.filter($=>Array.isArray($.rows)&&$.rows.length).map($=>`<div class="mp-table-wrap">
|
|
1794
1806
|
<div class="mp-table-h">${a($.title)}</div>
|
|
1795
1807
|
<div class="mp-table-scroll"><table class="mp-table">
|
|
1796
|
-
<thead><tr>${$.columns.map(
|
|
1797
|
-
<tbody>${$.rows.map(
|
|
1808
|
+
<thead><tr>${$.columns.map(me=>`<th scope="col">${a(me)}</th>`).join("")}</tr></thead>
|
|
1809
|
+
<tbody>${$.rows.map(me=>`<tr>${me.map((k,H)=>`<td data-label="${a($.columns[H]||"")}">${a(k)}</td>`).join("")}</tr>`).join("")}</tbody>
|
|
1798
1810
|
</table></div>
|
|
1799
|
-
</div>`).join("")}</div>`:"",
|
|
1800
|
-
`).map(
|
|
1811
|
+
</div>`).join("")}</div>`:"",f=$=>String($||"").split(`
|
|
1812
|
+
`).map(me=>`<div class="mp-it-p">${a(me).replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>")}</div>`).join(""),x=e.sections&&e.sections.length?`<div class="mp-it-secs">${e.sections.map($=>`<div class="mp-it-sec${$.tone?` tone-${a($.tone)}`:""}" id="mp-sec-${a($.key)}">
|
|
1801
1813
|
<div class="mp-it-sh">${a($.label)}</div>
|
|
1802
|
-
<div class="mp-it-stext">${Array.isArray($.items)&&$.items.length?
|
|
1803
|
-
</div>`).join("")}</div>`:"",
|
|
1814
|
+
<div class="mp-it-stext">${Array.isArray($.items)&&$.items.length?Pt($.items):f($.text)}</div>
|
|
1815
|
+
</div>`).join("")}</div>`:"",E=[e.systemLabel,Dt[e.moduleType]||e.moduleType].filter(Boolean),S=e.ask,L=S&&S.question?a(S.question):"",j=S&&(L||S.direction&&S.direction!=="general")?`<div class="mp-it-ask">${L?`<span class="ask-q">问题:${L}</span><span class="ask-sep">|</span>`:""}<span class="ask-d">询问方向:${a(S.directionLabel||"综合")}</span></div>`:"",M=e.answer?`<div class="mp-it-ans"><b>${L?"先答所问":"先看结论"}</b>${a(e.answer)}</div>`:"",J=e.plain?`<div class="mp-it-plain"><b>说人话</b>${a(e.plain)}</div>`:"",P=e.followups&&e.followups.length?`<div class="mp-it-fu"><b>还可以这样追问</b><ul>${e.followups.map($=>`<li>${a($)}</li>`).join("")}</ul></div>`:"",w=e.glossary&&e.glossary.length?`<details class="mp-it-gloss"><summary>名词解释(${e.glossary.length} 条)</summary>${e.glossary.map($=>`<div><span>${a($.term)}</span>${a($.plain)}</div>`).join("")}</details>`:"",z=e.limits&&e.limits.length?`<details class="mp-it-limits"><summary>本插件不回答什么(${e.limits.length} 条)</summary>${e.limits.map($=>`<div><b>${a($.title)}</b>${a($.text)}</div>`).join("")}</details>`:"",F=e.system&&/^(liuyao|meihua|daliuren|qimen|tarot|xiaoliuren)$/.test(e.system)?`<div class="mp-askcopy-row"><button type="button" class="mp-askcopy" data-mp-askcopy="${a(e.system)}">复制问事提示</button><span class="mp-askcopy-hint">把这张盘和你的问题打包成一段提示,粘到任何对话里都能用</span></div>`:"",pe=e.guide?`<details class="mp-guide">
|
|
1804
1816
|
<summary><b>${a(e.guide.title)}</b><span class="mp-guide-sub">数 / 象 / 辞</span></summary>
|
|
1805
1817
|
<div class="mp-guide-body">
|
|
1806
1818
|
<p class="mp-guide-lead">${a(e.guide.lead)}</p>
|
|
@@ -1811,47 +1823,47 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1811
1823
|
</div></details>`:"";return`<div class="mp-it${l?" folded":""}">
|
|
1812
1824
|
<button type="button" class="mp-it-head" aria-expanded="${l?"false":"true"}">
|
|
1813
1825
|
<span class="mp-it-arrow" aria-hidden="true">▾</span>
|
|
1814
|
-
<span class="mp-it-title">解析与详解</span>${
|
|
1826
|
+
<span class="mp-it-title">解析与详解</span>${E.map($=>`<span class="mp-it-tag">${a($)}</span>`).join("")}
|
|
1815
1827
|
<span class="mp-it-hint">${l?"点击展开":"点击收起"}</span>
|
|
1816
1828
|
</button>
|
|
1817
1829
|
<div class="mp-it-wrap">
|
|
1818
|
-
${
|
|
1830
|
+
${F}
|
|
1819
1831
|
${j}
|
|
1820
|
-
${
|
|
1821
|
-
${
|
|
1832
|
+
${M}
|
|
1833
|
+
${J}
|
|
1822
1834
|
${e.lead?`<div class="mp-it-lead">${a(e.lead)}</div>`:""}
|
|
1823
1835
|
${e.error?`<div class="mp-it-err"><b>⚠ 解析生成失败</b>${a(e.error)}——上方盘面数据本身可用</div>`:""}
|
|
1824
|
-
${
|
|
1836
|
+
${pe}
|
|
1825
1837
|
${d}
|
|
1826
1838
|
${m}
|
|
1827
1839
|
<div class="mp-it-body">${c}</div>
|
|
1828
|
-
${
|
|
1840
|
+
${x}
|
|
1829
1841
|
${u}
|
|
1830
|
-
${
|
|
1842
|
+
${P}
|
|
1831
1843
|
${w}
|
|
1832
1844
|
${z}
|
|
1833
1845
|
<div class="mp-it-dis">${a(e.disclaimer)}</div>
|
|
1834
1846
|
</div>
|
|
1835
|
-
</div>`},
|
|
1847
|
+
</div>`},n.followupHTML=function(e){if(!e)return"";const i=e.evidence&&e.evidence.length?`<div class="mp-fu-ev">依据:${e.evidence.map(r=>a(r)).join(";")} 置信度:${a(e.confidence||"弱")}</div>`:"";return`<div class="mp-fu${e.ok?"":" miss"}">
|
|
1836
1848
|
<div class="mp-fu-h">追问 · ${a(e.question)}</div>
|
|
1837
1849
|
<div class="mp-fu-a">${a(e.answer)}</div>
|
|
1838
1850
|
${i}
|
|
1839
|
-
</div>`},
|
|
1851
|
+
</div>`},n.resultWithInterpret=function(e,i,r){return(e||"")+n.interpretHTML(i,r)},n.caliberHTML=function(e){const i=e&&Array.isArray(e.switches)?e.switches.filter(u=>u&&u.key):[];if(!i.length)return"";const r=i.filter(u=>!u.error&&u.total>0),l=r.length?`${i.length} 组开关中 ${r.length} 组影响此盘:${r.map(u=>u.short||u.title).join("、")}。`:`本盘对 ${i.length} 组开关都不敏感:换成另一档也不变。`,o=u=>{if(u.error)return`<div class="mp-cdiff-same">未能对照:${a(u.error)}</div>`;if(!u.total)return'<div class="mp-cdiff-same">无变化 · 此盘不受这一开关影响</div>';const f=Array.isArray(u.roots)?u.roots:[];return f.length?`<div class="mp-cdiff-roots">${f.map(x=>`<div class="mp-cdiff-root"><span class="mp-cdiff-k">${a(x.label)}</span><span class="mp-cdiff-from">${a(x.from)}</span><span class="mp-cdiff-arrow" aria-hidden="true">→</span><span class="mp-cdiff-to">${a(x.to)}</span></div>`).join("")}</div>`:`<div class="mp-cdiff-same">无单一根因;逐字段差异 ${Number(u.total)||0} 处</div>`},c=u=>{const f=(Array.isArray(u.views)?u.views:[]).filter(x=>x&&x.changed);return u.error||!u.total||!f.length?"":`<table class="mp-cview"><thead><tr><th scope="col">项</th><th scope="col">${a(u.currentLabel)}</th><th scope="col">${a(u.altLabel)}</th></tr></thead><tbody>`+f.map(x=>`<tr><th scope="row">${a(x.label)}</th><td>${a(x.current)}</td><td>${a(x.alt)}</td></tr>`).join("")+"</tbody></table>"},d=u=>{const f=Array.isArray(u.categories)?u.categories:[];if(u.error||!u.total||!f.length)return"";const x=f.slice(0,6);return`<div class="mp-cdiff-cats">${x.map(E=>`<span class="mp-cdiff-cat">${a(E.name)} ${Number(E.count)||0} 处</span>`).join("")}`+(f.length>x.length?`<span class="mp-cdiff-cat">另 ${f.length-x.length} 类</span>`:"")+"</div>"},m=i.map(u=>`<div class="mp-cdiff-row"><div class="mp-cdiff-h"><b>${a(u.title)}</b><span class="mp-cdiff-count${u.total>0?" on":""}">${u.error?"未能对照":u.total?`${Number(u.total)||0} 处`:"无变化"}</span></div><div class="mp-cdiff-ab"><span class="mp-cdiff-pill now">当前 · ${a(u.currentLabel)}</span><span class="mp-cdiff-arrow" aria-hidden="true">→</span><span class="mp-cdiff-pill alt">换成 · ${a(u.altLabel)}</span></div>${o(u)}${c(u)}${d(u)}</div>`).join("");return`<details class="mp-cdiff" aria-label="口径对照">
|
|
1840
1852
|
<summary><span class="mp-cdiff-title">口径对照</span><span class="mp-cdiff-lead">${a(l)}</span><span class="mp-cdiff-more">展开逐字差异</span></summary>
|
|
1841
1853
|
<div class="mp-cdiff-body">${m}
|
|
1842
1854
|
<div class="mp-cdiff-note">同一组输入、只换一个开关;只列变化字段与根因,不判哪套口径更准,也不改上方盘面。</div>
|
|
1843
1855
|
</div>
|
|
1844
|
-
</details>`},
|
|
1856
|
+
</details>`},n.handleHTML=function(e){return typeof e!="string"||!e?"":`<section class="mp-handle" aria-label="排盘句柄">
|
|
1845
1857
|
<span class="mp-handle-title">排盘句柄</span>
|
|
1846
1858
|
<code class="mp-handle-code" title="${a(e)}">${a(e)}</code>
|
|
1847
1859
|
<button type="button" class="mp-handle-copy" data-handle-copy="${a(e)}" aria-label="复制排盘句柄">复制句柄</button>
|
|
1848
1860
|
<span class="mp-handle-hint">追问同一张盘时把它连同增量参数(年份、方向、所问之事)一并交给助手,不必重报出生信息。句柄是编码不是加密,含出生时间与出生地,别公开贴出。</span>
|
|
1849
|
-
</section>`},
|
|
1861
|
+
</section>`},n.revisionHTML=function(e){if(!e||typeof e!="object")return"";const i=Array.isArray(e.applied)?e.applied:[],r=Array.isArray(e.ignored)?e.ignored:[];if(!i.length&&!r.length)return"";const l=i.map(o=>{const c=o.fromDisplay==null?"(未设)":o.fromDisplay;return`<li><span class="k">${a(o.label||o.key)}</span><span class="v"><span class="old">${a(c)}</span> → <span class="new">${a(o.display)}</span></span></li>`}).join("");return`<section class="mp-revise" aria-label="一句话改参">
|
|
1850
1862
|
<div class="mp-revise-head"><span class="mp-revise-title">一句话改参</span><span class="mp-revise-text">「${a(e.text||"")}」</span></div>
|
|
1851
1863
|
${l?`<ul class="mp-revise-list">${l}</ul>`:'<p class="mp-revise-ignored">没有识别到可改的参数,仍按原参数排盘。</p>'}
|
|
1852
1864
|
${r.length?`<p class="mp-revise-ignored">未处理:${a(r.join(";"))}</p>`:""}
|
|
1853
|
-
</section>`},
|
|
1854
|
-
<summary><b>与上次同盘比对</b><span class="tag">${u} → ${
|
|
1865
|
+
</section>`},n.shadowHTML=function(e,i){if(!e||!e.id)return"";const r=[];e.version&&r.push(`版本 <b>${a(e.version)}</b>`),e.baseId&&r.push(`基础指纹 <b>${a(e.baseId)}</b>`),r.push("同参数同 ID");const l=[];e.reproducible===!1&&l.push(`不可复算:${a(e.reason||"参数不足")}`);const o=e.reproducible===!0&&e.asOfPinned===!1&&(e.system==="bazi"||e.system==="ziwei")?'<div class="mp-shadow-hint">未固定 asOf:流年 / 流月随「此刻」变化;要逐字比对请在输入里固定 asOf。</div>':"",c=i&&i.sameId!==!1&&(i.versionChanged||Number(i.total)>0);let d="";if(c){const m=Number(i.total)||0,u=a(i.fromVersion||"—"),f=a(i.toVersion||e.version||"—"),x=Array.isArray(i.roots)?i.roots:[],E=x.slice(0,8),S=E.length?`<div class="mp-cdiff-roots">${E.map(M=>`<div class="mp-cdiff-root"><span class="mp-cdiff-k">${a(M.label)}</span><span class="mp-cdiff-from">${a(M.from)}</span><span class="mp-cdiff-arrow" aria-hidden="true">→</span><span class="mp-cdiff-to">${a(M.to)}</span></div>`).join("")}`+(x.length>E.length?`<div class="same">另 ${x.length-E.length} 处根因</div>`:"")+"</div>":`<div class="same">${m?"无单一根因;逐字段变化 "+m+" 处":"字段 0 处变化:同一张盘跨版本逐字一致"}</div>`,L=Array.isArray(i.categories)?i.categories:[],j=L.length?`<div class="mp-cdiff-cats">${L.slice(0,6).map(M=>`<span class="mp-cdiff-cat">${a(M.name)} ${Number(M.count)||0} 处</span>`).join("")}`+(L.length>6?`<span class="mp-cdiff-cat">另 ${L.length-6} 类</span>`:"")+"</div>":"";d=`<details class="mp-shadow-diff"${m>0?" open":""}>
|
|
1866
|
+
<summary><b>与上次同盘比对</b><span class="tag">${u} → ${f} · ${m?`${m} 处变化`:"0 处变化"}</span></summary>
|
|
1855
1867
|
${S}${j}
|
|
1856
1868
|
<div class="note">同一 baseId(同一组归一化参数)的两次结果;只比盘面字段,不含摘要、解析与古籍等文本层。</div>
|
|
1857
1869
|
</details>`}return`<section class="mp-shadow" aria-label="影子盘">
|
|
@@ -1861,35 +1873,35 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1861
1873
|
${l.map(m=>`<div class="mp-shadow-warn">⚠ ${m}</div>`).join("")}
|
|
1862
1874
|
${o}
|
|
1863
1875
|
${d}
|
|
1864
|
-
</section>`},
|
|
1876
|
+
</section>`},n.shadowTrack=function(e){const i=window.Engine||window.__PP&&window.__PP.Engine;if(!i||!i.shadowSnapshot||!i.shadowDiff)return null;let r=null;try{r=i.shadowSnapshot(e)}catch{return null}if(!r||!r.shadow||!r.shadow.baseId)return null;const l="mp-shadow-v1";let o={};try{const m=window.localStorage?window.localStorage.getItem(l):null,u=m?JSON.parse(m):{};u&&typeof u=="object"&&!Array.isArray(u)&&(o=u)}catch{o={}}const c=o[r.shadow.baseId];let d=null;if(c)try{d=i.shadowDiff(c,r)}catch{d=null}r.at=Date.now(),o[r.shadow.baseId]=r;try{const m=Object.keys(o);if(m.length>24){m.sort((u,f)=>(Number(o[u]&&o[u].at)||0)-(Number(o[f]&&o[f].at)||0));for(const u of m.slice(0,m.length-24))delete o[u]}window.localStorage&&window.localStorage.setItem(l,JSON.stringify(o))}catch{}return d};const Rt="dsh-metaphysics/profiles-v1",Ce=24,It=16,aa=40,Ae=60,Gt=["bazi","ziwei","liuyao","tarot","meihua","daliuren","hepan","qimen","almanac","zeri","chenggu","xiaoliuren","star","numerology","mbti","trend","fengshui","name","convert"];n.PROF_KEY=Rt,n.PROF_MAX=Ce,n.PROF_KINDS=Gt;const Bt={bazi:"八字",ziwei:"紫微",liuyao:"六爻",tarot:"塔罗",meihua:"梅花",daliuren:"六壬",hepan:"合盘",qimen:"奇门",almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",mbti:"人格",trend:"人生K线",fengshui:"风水",name:"起名",convert:"农历"};n.profKindLabel=e=>Bt[e]||String(e||"");const De=e=>typeof e=="string";function rt(e){if(!e||typeof e!="object"||Array.isArray(e)||!De(e.id)||!e.id||e.id.length>40||!De(e.kind)||Gt.indexOf(e.kind)<0)return null;const i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e.date||""));if(!i)return null;const r=Number(i[1]),l=Number(i[2]),o=Number(i[3]);if(l<1||l>12||o<1||o>new Date(r,l,0).getDate())return null;const c=De(e.time)&&/^([01]?\d|2[0-3]):[0-5]\d$/.test(e.time)?e.time:"";return{id:e.id,kind:e.kind,label:De(e.label)?e.label.slice(0,It):"",date:e.date,time:e.hourUnknown===!0?"":c,hourUnknown:e.hourUnknown===!0,trueSolar:e.trueSolar!==!1,lateZi:e.lateZi!==!1,gender:e.gender==="male"||e.gender==="female"?e.gender:"",address:De(e.address)?e.address.slice(0,aa):"",note:De(e.note)?e.note.slice(0,Ae):"",pinned:e.pinned===!0,createdAt:Number(e.createdAt)||0,lastUsedAt:Number(e.lastUsedAt)||0,uses:Number(e.uses)||0}}function pt(){try{const e=window.localStorage?window.localStorage.getItem(Rt):null,i=e?JSON.parse(e):[];return Array.isArray(i)?i:[]}catch{return[]}}function at(e){return e.slice().sort((i,r)=>(r.pinned?1:0)-(i.pinned?1:0)||(r.lastUsedAt||r.createdAt||0)-(i.lastUsedAt||i.createdAt||0)||(r.createdAt||0)-(i.createdAt||0))}n.profilesLoad=function(){const e=[],i=Object.create(null);for(const r of pt()){const l=rt(r);l&&!i[l.id]&&(i[l.id]=1,e.push(l))}return at(e)},n.profilesSave=function(e){const i=at(Array.isArray(e)?e.slice(0,Ce):[]);try{return window.localStorage?(window.localStorage.setItem(Rt,JSON.stringify(i)),!0):!1}catch{return!1}};let qt=0;n.profilesNewId=function(){const e=Object.create(null);for(const r of n.profilesLoad())e[r.id]=1;let i;do i=`p${Date.now().toString(36)}${(qt++).toString(36)}`;while(e[i]);return i},n.profilesPut=function(e){const i=rt(Object.assign({id:n.profilesNewId(),createdAt:Date.now(),lastUsedAt:Date.now()},e));if(!i)return{ok:!1,list:n.profilesLoad()};const r=n.profilesLoad(),l=r.findIndex(o=>o.id===i.id);if(l>=0){const o=r[l];i.createdAt=o.createdAt||i.createdAt,i.lastUsedAt=o.lastUsedAt,i.uses=o.uses,i.pinned=o.pinned,r.splice(l,1,i)}else r.push(i);if(r.length>Ce){const o=r.slice().sort((m,u)=>(m.lastUsedAt||m.createdAt)-(u.lastUsedAt||u.createdAt)),c=o.find(m=>m.id!==i.id)||o[0],d=r.indexOf(c);d>=0&&r.splice(d,1)}return n.profilesSave(r)?{ok:!0,list:at(r),item:i}:{ok:!1,list:n.profilesLoad()}},n.profilesRemove=function(e){const i=n.profilesLoad().filter(r=>r.id!==e);return n.profilesSave(i)?i:n.profilesLoad()},n.profilesPin=function(e){const i=n.profilesLoad().map(r=>r.id===e?Object.assign({},r,{pinned:!r.pinned}):r);return n.profilesSave(i)?at(i):n.profilesLoad()},n.profilesTouch=function(e){let i=!1;const r=n.profilesLoad().map(l=>l.id!==e?l:(i=!0,Object.assign({},l,{lastUsedAt:Date.now(),uses:(l.uses||0)+1})));return i?n.profilesSave(r)?at(r):n.profilesLoad():r};const ia=864e5;function Ue(e){const i=Number(e)||0;if(!i)return"未排过";const r=Math.floor((Date.now()-i)/ia);if(r<=0)return"今天排过";if(r===1)return"昨天排过";if(r<30)return`${r} 天前排过`;const l=new Date(i);return`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")} 排过`}n.profilesAgo=Ue;const Zt={male:"♂",female:"♀"};n.profilesHTML=function(e,i){const r=i||{},l=(Array.isArray(e)?e:[]).map(c=>{const d=rt(c);if(!d)return"";const m=[d.date,d.hourUnknown?"时辰未知":d.time,d.address].filter(Boolean).join(" "),u=r.editingId&&d.id===r.editingId,f=r.armedDel&&d.id===r.armedDel;return`<div class="mp-prof-card${d.pinned?" pinned":""}${u?" editing":""}" data-id="${a(d.id)}">
|
|
1865
1877
|
<button type="button" class="mp-prof-use" data-mp-prof="use" data-id="${a(d.id)}"
|
|
1866
1878
|
title="${a(`用「${d.label||d.kind}」的出生信息直接排盘`)}">
|
|
1867
|
-
<span class="mp-prof-nm">${a(d.label||"未命名")}${d.gender?`<i class="sx">${
|
|
1868
|
-
<span class="mp-prof-sys">${a(
|
|
1879
|
+
<span class="mp-prof-nm">${a(d.label||"未命名")}${d.gender?`<i class="sx">${Zt[d.gender]||""}</i>`:""}</span>
|
|
1880
|
+
<span class="mp-prof-sys">${a(n.profKindLabel?n.profKindLabel(d.kind):d.kind)}</span>
|
|
1869
1881
|
<span class="mp-prof-bd">${a(m)}</span>
|
|
1870
|
-
<span class="mp-prof-at">${a(
|
|
1882
|
+
<span class="mp-prof-at">${a(Ue(d.lastUsedAt||d.createdAt))}${d.uses?` · ${d.uses} 次`:""}${d.pinned?" · 置顶":""}</span>
|
|
1871
1883
|
</button>
|
|
1872
1884
|
<span class="mp-prof-ops">
|
|
1873
1885
|
<button type="button" data-mp-prof="pin" data-id="${a(d.id)}" class="${d.pinned?"on":""}"
|
|
1874
1886
|
aria-pressed="${d.pinned?"true":"false"}" title="置顶这张档案">${d.pinned?"已置顶":"置顶"}</button>
|
|
1875
1887
|
<button type="button" data-mp-prof="edit" data-id="${a(d.id)}" title="把这张档案读回输入框,改完再存">改名</button>
|
|
1876
|
-
<button type="button" data-mp-prof="del" data-id="${a(d.id)}" class="${
|
|
1877
|
-
title="${
|
|
1888
|
+
<button type="button" data-mp-prof="del" data-id="${a(d.id)}" class="${f?"on":""}"
|
|
1889
|
+
title="${f?"再点一次就从本机删除这张档案":"从本机删除这张档案(点两次确认)"}">${f?"确认删除":"删除"}</button>
|
|
1878
1890
|
</span>
|
|
1879
1891
|
</div>`}).join(""),o=l?`<div class="mp-prof-list">${l}</div>`:'<p class="mp-prof-empty">还没有存过命盘。填好出生信息,给这张盘起个称呼,点「存为我的命盘」——下次进来一点就出盘,不必重报。</p>';return`<section class="mp-prof" aria-label="我的命盘">
|
|
1880
|
-
<div class="mp-prof-h"><b>我的命盘</b><span class="mp-prof-sub">只存本机 · 不上传${e&&e.length?` · ${e.length}/${
|
|
1892
|
+
<div class="mp-prof-h"><b>我的命盘</b><span class="mp-prof-sub">只存本机 · 不上传${e&&e.length?` · ${e.length}/${Ce}`:""}</span></div>
|
|
1881
1893
|
${o}
|
|
1882
1894
|
${r.bar||""}
|
|
1883
|
-
</section>`},
|
|
1884
|
-
<input class="mp-prof-name" type="text" maxlength="${
|
|
1895
|
+
</section>`},n.profilesBarHTML=function(e){const i=e||{};return`<div class="mp-prof-bar">
|
|
1896
|
+
<input class="mp-prof-name" type="text" maxlength="${It}" placeholder="称呼,如「我」「妈妈」" aria-label="档案称呼" value="${a(i.name||"")}">
|
|
1885
1897
|
<button type="button" data-mp-prof="put"${i.canAdd===!1?" disabled":""}>${a(i.editingId?"更新这张档案":"存为我的命盘")}</button>
|
|
1886
1898
|
${i.editingId?'<button type="button" class="ghost" data-mp-prof="cancel">取消改名</button>':""}
|
|
1887
1899
|
<span class="mp-prof-tip">${a(i.tip||(i.editingId?"改完出生信息或称呼,点「更新这张档案」覆盖原档。":"存的是出生时间与出生地这些输入,不是结果。"))}</span>
|
|
1888
|
-
</div>`},
|
|
1889
|
-
<summary><span class="mp-trace-no">${
|
|
1900
|
+
</div>`},n.profEvent=function(e){let i=e&&e.closest?e.closest("[data-mp-prof]"):null;if(!i)return null;const r=i.getAttribute("data-mp-prof");return i.tagName==="BUTTON"&&i.disabled?null:{action:r,id:i.getAttribute("data-id")||"",name:i}};const St=["bazi","trend"],na=["bazi","ziwei","liuyao","meihua","daliuren","qimen","hepan","chenggu","trend","fengshui","name","xiaoliuren"];n.profUsable=function(e){return!e||typeof e!="object"?!1:e.hourUnknown===!0||e.time?!0:na.indexOf(String(e.kind||""))<0},n.profFromForm=function(e,i,r){const l=e||{},o=l.hourUnknown===!0&&St.indexOf(String(l.kind||""))>=0;return!o&&!/^([01]?\d|2[0-3]):[0-5]\d$/.test(String(l.time||"").trim())?null:rt(Object.assign({id:r||n.profilesNewId(),kind:String(l.kind||""),label:String(i||"").trim().slice(0,It)||(n.profKindLabel?n.profKindLabel(l.kind):String(l.kind||"")),date:String(l.date||""),time:String(l.time||""),hourUnknown:o,gender:String(l.gender||""),address:String(l.address||""),trueSolar:l.trueSolar!==!1,lateZi:l.lateZi!==!1,pinned:!1,createdAt:Date.now(),lastUsedAt:0,uses:0}))},n.traceHTML=function(e,i,r){if(!Array.isArray(e)||!e.length)return"";const l={liuyao:"六爻",bazi:"八字",ziwei:"紫微",qimen:"奇门",daliuren:"大六壬"}[i]||"命盘",o=e.map(u=>u&&u.field).filter(Boolean).join(" → "),c=typeof r=="string"?r:"",d=(u,f)=>{const x=String(u??"");return x.length>f?`${x.slice(0,f)}…`:x},m=e.map((u,f)=>{const x=Array.isArray(u.inputs)?u.inputs:[];return`<details class="mp-trace-step"${f===0?" open":""}>
|
|
1901
|
+
<summary><span class="mp-trace-no">${f+1}</span><span class="mp-trace-field">${a(u.field)}</span><span class="mp-trace-res">${a(d(u.result,44))}</span></summary>
|
|
1890
1902
|
<div class="mp-trace-detail">
|
|
1891
1903
|
<div class="mp-trace-rule"><b>规则</b>${a(u.rule)}</div>
|
|
1892
|
-
${
|
|
1904
|
+
${x.length?`<dl class="mp-trace-inputs">${x.map(E=>`<dt>${a(E.label)}</dt><dd>${a(E.value)}</dd>`).join("")}</dl>`:""}
|
|
1893
1905
|
<div class="mp-trace-result"><b>结果</b>${a(u.result)}</div>
|
|
1894
1906
|
${u.source?`<div class="mp-trace-src"><b>出处</b>${a(u.source)}</div>`:""}
|
|
1895
1907
|
</div>
|
|
@@ -1907,7 +1919,7 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1907
1919
|
<div class="mp-trace-body">${m}</div>
|
|
1908
1920
|
${c?`<textarea class="mp-trace-md" data-trace-md readonly hidden>${a(c)}</textarea>`:""}
|
|
1909
1921
|
</aside>
|
|
1910
|
-
</div>`},
|
|
1922
|
+
</div>`},n.almanacHTML=function(e){if(!e||!e.meta)return n.quickHTML(e);const i=e.ganzhi||{},r=e.dayGod||null,l=(L,j)=>(L||[]).map(M=>`<span class="mp-al-chip${j?` ${j}`:""}">${a(M)}</span>`).join(""),o=(L,j)=>j?`<div class="mp-al-cell"><em>${a(L)}</em><b>${a(j)}</b></div>`:"",c=e.xiu?`${e.xiu.name}宿(${e.xiu.luck}·${e.xiu.zheng}·${e.xiu.animal})`:"",d=e.nayin&&e.nayin.day?e.nayin.day.name:"",m=e.chong?`${e.chong.text}${e.chong.sha?` ${e.chong.sha}`:""}`:"",u=(e.hours||[]).map(L=>`<span class="mp-al-hour ${L.luck==="吉"?"good":"bad"}"><i>${a(L.zhi)}</i><em>${a((L.ganZhi||"").slice(0,1))}</em><b>${a(L.shen||"")}</b><u>${a(L.luck||"")}</u></span>`).join(""),f=e.positions||{},x=(L,j)=>j?`<span class="mp-al-chip">${a(L)}·${a(typeof j=="string"?j:j.dir||"")}</span>`:"",E=e.lucky||{},S=r?`<span class="mp-al-badge ${r.luck==="吉"?"good":"bad"}">${a(r.name)}·${a(r.type)}·${a(r.luck)}</span>`:"";return`<section class="mp-al" aria-label="黄历">
|
|
1911
1923
|
<div class="mp-al-h"><b>${a(e.meta.date||"")}</b><i>${a(e.meta.weekday||"")} ${a((e.lunar||{}).text||"")}</i></div>
|
|
1912
1924
|
<div class="mp-al-gz">${a(i.year||"")}年 ${a(i.month||"")}月 ${a(i.day||"")}日 属${a(i.shengXiao||"")} 建除 ${a(e.zhiXing||"")}日 ${S}</div>
|
|
1913
1925
|
<div class="mp-al-yiji">
|
|
@@ -1915,12 +1927,12 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1915
1927
|
<div class="mp-al-col"><em>忌</em><div class="mp-al-chips">${l(e.ji)}</div></div>
|
|
1916
1928
|
</div>
|
|
1917
1929
|
<div class="mp-al-grid">${o("二十八宿",c)}${o("日柱纳音",d)}${o("胎神",e.taiShen)}${o("冲煞",m)}</div>
|
|
1918
|
-
<div class="mp-al-row"><em>吉神方位</em><div class="mp-al-chips">${
|
|
1930
|
+
<div class="mp-al-row"><em>吉神方位</em><div class="mp-al-chips">${x("喜神",f.xiShen)}${x("财神",f.caiShen)}${x("福神",f.fuShen)}${x("阳贵",f.yangGui)}${x("阴贵",f.yinGui)}</div></div>
|
|
1919
1931
|
<div class="mp-al-row"><em>时刻吉凶</em><div class="mp-al-hours">${u}</div></div>
|
|
1920
|
-
<div class="mp-al-row"><em>吉配生肖</em><div class="mp-al-chips">${
|
|
1932
|
+
<div class="mp-al-row"><em>吉配生肖</em><div class="mp-al-chips">${E.liuhe?`<span class="mp-al-chip">六合·${a(E.liuhe)}</span>`:""}${l(E.sanhe||[])}</div></div>
|
|
1921
1933
|
${e.dailyHexagram?`<div class="mp-al-hex">每日一卦:<b>${a(e.dailyHexagram.name)}</b> ${a(e.dailyHexagram.meaning||"")}</div>`:""}
|
|
1922
1934
|
<div class="mp-al-note">${a(e.meta&&e.meta.scope||"")}</div>
|
|
1923
|
-
</section>`},
|
|
1935
|
+
</section>`},n.mbtiHTML=function(e){if(!e)return"";if(e.needAnswers&&Array.isArray(e.questions)){const o=e.questions.map(c=>`<li>${a(c.text)}</li>`).join("");return`<section class="mp-mb-paper" aria-label="十六型人格问卷">
|
|
1924
1936
|
<div class="mp-mb-h">
|
|
1925
1937
|
<span class="mp-mb-meta"><b>十六型人格问卷</b><i>${e.total} 题 · 每题 1 完全不像 / 5 很像我</i></span>
|
|
1926
1938
|
<span class="mp-mb-count">填完分数再看结果</span>
|
|
@@ -1952,13 +1964,13 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1952
1964
|
<div class="mp-mb-sec"><em>课题</em>${a(r.growth||"")}</div>
|
|
1953
1965
|
</div>
|
|
1954
1966
|
<div class="mp-mb-note">${a(e.note||"")}</div>
|
|
1955
|
-
</section>`};const lt=[["巽","离","坤"],["震","中","兑"],["艮","坎","乾"]],
|
|
1967
|
+
</section>`};const lt=[["巽","离","坤"],["震","中","兑"],["艮","坎","乾"]],sa={坎:"正北",艮:"东北",震:"正东",巽:"东南",离:"正南",坤:"西南",兑:"正西",乾:"西北",中:"中宫"},it=["生气","延年","天医","伏位"],Se=(e,i)=>`<span class="mp-fs-chip${i?" "+i:""}">${a(e)}</span>`,Pe=(e,i,r)=>`<div class="mp-fs-cell${e==="中"?" center":""}"><div class="mp-fs-top"><span class="mp-fs-gua">${a(e)}</span><span class="mp-fs-dir">${a(sa[e]||"")}</span>${i||""}</div>`+(r||"")+"</div>",Nt=e=>e.length?`<dl class="mp-fs-facts">${e.map(([i,r])=>`<div class="mp-fs-row"><dt>${a(i)}</dt><dd>${a(r)}</dd></div>`).join("")}</dl>`:"",Te=(e,i,r,l,o,c)=>`<section class="mp-quick mp-fs" aria-label="风水结果"><div class="mp-quick-h"><b>${a(e)}</b>${i?`<span class="mp-fs-sub">${a(i)}</span>`:""}</div>`+(r.length?`<div class="mp-fs-chips">${r.join("")}</div>`:"")+l+o+c.filter(Boolean).map(d=>`<div class="mp-fs-note">${a(d)}</div>`).join("")+"</section>",Mt=(e,i)=>`<div class="mp-fs-grid" role="group" aria-label="${a(i)}">`+lt.map(r=>r.map(l=>{const o=e.find(m=>m&&m.palace===l);if(!o)return Pe(l,"","");const c=it.includes(o.star),d=`<span class="mp-fs-star"${o.role?` title="${a(o.role)}"`:""}>${a(o.star)}<em class="${c?"ok":"bad"}">${c?"吉":"凶"}</em></span>`;return Pe(l,d,"")}).join("")).join("")+"</div>";function dt(e,i){const r=i.period,l={};for(const S of e.palaces||[])l[S.palace]=S;const o=`<div class="mp-fs-key">每宫依次为 <b>运</b>/<b>山</b>/<b>向</b> 三星;底色高亮=当运(${a(r)}运)</div><div class="mp-fs-grid" role="group" aria-label="玄空九宫(运/山/向)">`+lt.map(S=>S.map(L=>{const j=l[L];if(!j)return Pe(L,"","");const M=[["运",j.yun],["山",j.shan],["向",j.xiang]].map(([J,P])=>`<span class="${P===r?"on":""}" title="${a(J)}星 ${a(P)}">${a(P)}</span>`).join("");return Pe(L,"",`<div class="mp-fs-nums">${M}</div>`)}).join("")).join("")+"</div>",c=e.wangShanWangXiang||{},d=i.jianXiang||{},m=e.timeFlying||null,u=[Se(d.active?`兼${d.jian} ${d.offset}° · 替卦`:"正向 · 下卦",d.active?"ok":""),Se(`山盘 ${i.shanCenter.star}${i.shanCenter.name} · ${i.shanCenter.fly}`),Se(`向盘 ${i.xiangCenter.star}${i.xiangCenter.name} · ${i.xiangCenter.fly}`),Se(c.byChart?"盘面:到山到向":"盘面:未到山到向",c.byChart?"ok":""),Se(c.byTable===null?"表法:替卦不套":c.byTable?"表法:在列":"表法:未列",c.byTable?"ok":"")],f=(S,L)=>`${L} ${S.star}${S.name}(${S.fly},${S.basis}${S.mode==="替卦"?`;原运星 ${S.original}${S.replaced?",已替":",用替而未替"}`:""})`,x=m?[["year","年"],["month","月"],["day","日"],["hour","时"]].filter(([S])=>m[S]).map(([S,L])=>`${L}${m[S].centerName}(${m[S].fly})`).join(" "):"",E=Nt([...d.active?[["替卦",`${d.note}${c.byTable===null?" 正向旺山旺向表不适用于替卦。":""}`]]:[],["入中",`${f(i.shanCenter,"山盘")};${f(i.xiangCenter,"向盘")}`],["当运",`山星${r}落 ${e.dangYun.shan.text};向星${r}落 ${e.dangYun.xiang.text}`],["合十",`山星:${(e.heshi.shan||[]).join("、")||"无"};向星:${(e.heshi.xiang||[]).join("、")||"无"}`],["表法",`${c.note||""}${(c.table||[]).length?` 本运所列:${c.table.join("、")}。`:" 本运表法无局。"}`],...x?[["年月日时",`${x}${m.meta&&m.meta.note?` ${m.meta.note}`:""}`]]:[]]);return Te(d.active?"玄空替卦":"玄空下卦",`${i.periodLabel} · 坐${i.sitting} · 向${i.facing}`,u,o,E,[i.note,e.disclaimer])}function oa(e,i){const r=e.mingGua||{},l=Mt([...e.luckyDirections||[],...e.unluckyDirections||[]],"八宅八向(吉凶)"),o=[Se(r.compatible||"—"),Se(`${i.gender}命 · ${i.guaYear} 年立春界`)],c=[];if(e.yearlyFlying){const d=e.yearlyFlying;c.push(["年紫白",`${d.centerName}入中;${d.palaces.filter(m=>m.palace!=="中").map(m=>`${m.palace}${m.name}`).join("、")}`])}return Te("八宅命卦",`${r.num}${r.gua}(${r.group})· ${r.direction}`,o,l,Nt(c),[i.note,e.disclaimer])}function Ct(e,i){const r=e.layout||{},l=Mt(e.houseStars||[],"宅卦八向(吉凶)"),o=[Se(`${i.houseGua}宅 · ${i.houseGroup}`),Se(`坐${i.sitting}`),Se(`向${i.facing}`)],c=[["门",r.door],["灶",r.stove],["床",r.bed],["厕",r.toilet]];return e.mingMatch&&c.push(["命宅配",e.mingMatch.text]),Te("门主灶",`${i.houseGua}宅 · 坐${i.sitting} · 向${i.facing}`,o,l,Nt(c),[i.birthNote,e.disclaimer])}n.fengshuiHTML=function(e){if(!e||e.system!=="fengshui")return n.quickHTML(e);const i=e.meta||{};return i.action==="xuankong"?dt(e,i):i.action==="advise"?Ct(e,i):oa(e,i)},n.perfHTML=function(e){if(!e)return"";const i=m=>typeof m=="number"&&isFinite(m)?`${Math.max(0,Math.round(m))}ms`:"",r=e.cached===!0?"(已缓存)":e.cached===!1?"(首次加载)":"",l=[];i(e.engineMs)&&l.push(`引擎 ${i(e.engineMs)}${r}`),i(e.computeMs)&&l.push(`排盘 ${i(e.computeMs)}`),i(e.renderMs)&&l.push(`渲染 ${i(e.renderMs)}`);const o=i(e.totalMs);if(!l.length&&!o)return"";const c=o?`首屏 ${o}`:"耗时";return`<div class="mp-perf" title="本机这一次的实测耗时,不含网络与服务端;换机器、首次加载与已缓存会不同">${l.length?`${c}|${l.join(" · ")}`:c}</div>`},n.zeriHTML=function(e){if(!e||!e.compare||e.compare.mode!=="candidates"||!Array.isArray(e.days))return n.quickHTML(e);const i=e.meta||{},r=e.shenshaRef||{},l=e.compare.best?e.compare.best.date:"",o=e.days.map(m=>{const u=m.date===l,f=m.excluded||m.verdict==="回避"?"bad":m.verdict==="推荐"?"good":"",x=m.grade||{},E=x.label?`<b>${a(x.label)}</b><em>吉${a(x.ji)} / 凶${a(x.xiong)} ${a(x.decision||"")}</em>`:"—";return`<tr class="mp-zr-row${u?" top":""}${m.excluded?" off":""}">
|
|
1956
1968
|
<th scope="row"><b>${a(m.date)}</b>${u?'<i class="mp-zr-best">最优</i>':""}
|
|
1957
1969
|
<em>${a(m.weekday)} ${a(m.lunar)}</em></th>
|
|
1958
1970
|
<td><b>${a(m.dayGanZhi)}</b><em>${a(m.zhiXing)}日</em></td>
|
|
1959
1971
|
<td class="mp-zr-score">${a(m.score)}</td>
|
|
1960
|
-
<td class="mp-zr-grade">${
|
|
1961
|
-
<td><span class="mp-zr-v ${
|
|
1972
|
+
<td class="mp-zr-grade">${E}</td>
|
|
1973
|
+
<td><span class="mp-zr-v ${f}">${a(m.verdict)}</span></td>
|
|
1962
1974
|
<td class="mp-zr-why">${a(m.reasons.join(";")||"无特别加减分")}</td>
|
|
1963
1975
|
</tr>`}).join(""),c=(m,u)=>`<span><em>${a(m)}</em>${u.length?a(u.join("、")):"无"}</span>`,d=e.compare.best?`这一组最优:<b>${a(e.compare.best.date)}</b>(${a(e.compare.best.score)} 分 · ${a(e.compare.best.verdict)})`+(e.compare.best.ties.length>1?`;同分 ${a(e.compare.best.ties.filter(m=>m!==e.compare.best.date).join("、"))}`:""):"这一组都因冲属相被排除,没有可用的日子";return`<section class="mp-zr" aria-label="择日候选比较">
|
|
1964
1976
|
<div class="mp-zr-h"><b>择日 · ${a(i.task||"")}</b>
|
|
@@ -1975,10 +1987,10 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
1975
1987
|
${r.juan10?`<p class="mp-zr-note">卷十依据:${a(r.juan10.text)}(${a(r.juan10.corpusLines||"")});${a(r.juan10.thresholdsNote||"")}${a(r.juan10.note||"")}</p>`:""}
|
|
1976
1988
|
<p class="mp-zr-note">${a(i.scope||"")}</p>
|
|
1977
1989
|
<p class="mp-zr-note">${a(e.disclaimer||"")}</p>
|
|
1978
|
-
</section>`},
|
|
1990
|
+
</section>`},n.quickHTML=function(e){if(!e)return"";const r={almanac:"黄历",zeri:"择日",chenggu:"称骨",xiaoliuren:"小六壬",star:"星座",numerology:"生命数字",trend:"人生 K 线",fengshui:"风水",name:"起名",convert:"公农历转换",mbti:"十六型人格"}[e.system]||"速查",l=e.summary||"",o=l?`<pre class="mp-quick-pre">${a(l)}</pre>`:"";return`<section class="mp-quick" aria-label="${a(r)}结果">
|
|
1979
1991
|
<div class="mp-quick-h"><b>${a(r)}</b></div>
|
|
1980
1992
|
${o}
|
|
1981
|
-
</section>`},
|
|
1993
|
+
</section>`},n.summaryCardPNG=function(e,i){try{if(typeof document>"u"||!document.createElement)return"";const r=i&&i.outline||[],l=(i&&i.tables||[]).filter(ae=>Array.isArray(ae.rows)&&ae.rows.length),o=i&&i.systemLabel||e&&e.system||"命理报告",c=900,d=44,m=26,u=(ae,F)=>`${F?"600 ":""}${ae}px "PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif`,f=document.createElement("canvas"),x=f.getContext?f.getContext("2d"):null;if(!x)return"";const E=(ae,F)=>{const pe=[];let $="";for(const me of String(ae)){const k=$+me;x.measureText(k).width>F&&$?(pe.push($),$=me):$=k}return $&&pe.push($),pe.length?pe:[""]};x.font=u(15);let S=0;const L=r.map(ae=>{const F=E(ae.text,c-d*2-70);return S+=Math.min(F.length,2)*m+10,{o:ae,lines:F.slice(0,2)}}),j=l[0]||null,M=j?j.rows.slice(0,6):[],J=j?54+M.length*34:0,P=150+S+(L.length?34:0)+J+120;f.width=c,f.height=P,x.fillStyle="rgb(255,255,255)",x.fillRect(0,0,c,P),x.fillStyle="rgb(31,111,63)",x.fillRect(0,0,c,8);let w=52;x.fillStyle="rgb(27,27,27)",x.font=u(28,!0),x.fillText(`${o} · 摘要`,d,w),w+=30,x.fillStyle="rgb(111,106,96)",x.font=u(14);const z=[e&&e.input&&e.input.datetime?`出生/起局:${e.input.datetime}`:"","本地计算 · 可复现"].filter(Boolean).join(" ");if(x.fillText(z,d,w),w+=34,L.length){x.fillStyle="rgb(31,111,63)",x.font=u(16,!0),x.fillText("一页读懂",d,w),w+=26;for(const{o:ae,lines:F}of L)x.fillStyle="rgb(138,131,120)",x.font=u(14,!0),x.fillText(ae.label,d,w),x.fillStyle="rgb(63,58,51)",x.font=u(15),F.forEach((pe,$)=>x.fillText(pe,d+70,w+$*m)),w+=F.length*m+10;w+=8}if(j){x.fillStyle="rgb(31,111,63)",x.font=u(16,!0),x.fillText(j.title,d,w),w+=24,x.fillStyle="rgb(138,131,120)",x.font=u(13),x.fillText(j.columns.join(" · "),d,w),w+=8,x.strokeStyle="rgb(229,225,216)",x.beginPath(),x.moveTo(d,w),x.lineTo(c-d,w),x.stroke(),w+=22,x.fillStyle="rgb(63,58,51)",x.font=u(14);for(const ae of M){const F=ae.filter(Boolean).join(" · "),pe=E(F,c-d*2)[0];x.fillText(pe,d,w),w+=34}}return w=P-62,x.strokeStyle="rgb(229,225,216)",x.beginPath(),x.moveTo(d,w-18),x.lineTo(c-d,w-18),x.stroke(),x.fillStyle="rgb(138,131,120)",x.font=u(12),x.fillText("内容用于传统文化学习与自我探索,不构成医疗、投资、法律或人事决策依据。",d,w+6),x.fillText("dsh-metaphysics · 本机计算,未上传任何数据",d,w+26),f.toDataURL?f.toDataURL("image/png"):""}catch{return""}}})();const Da="dsh-metaphysics/history-v1";function Di(){try{const s=window.localStorage&&window.localStorage.getItem(Da),n=s?JSON.parse(s):[];return Array.isArray(n)?n.filter(q=>q&&typeof q=="object"&&typeof q.kind=="string").slice(0,20):[]}catch{return[]}}function Pa(s){try{window.localStorage&&window.localStorage.setItem(Da,JSON.stringify(s.slice(0,20)))}catch{}}const Pi=(s,n)=>s.kind===n.kind&&s.date===n.date&&s.time===n.time&&s.gender===n.gender&&!!s.hourUnknown==!!n.hourUnknown&&s.trueSolar!==!1==(n.trueSolar!==!1)&&s.lateZi!==!1==(n.lateZi!==!1)&&s.address===n.address&&s.lines===n.lines&&s.question===n.question&&s.mhMode===n.mhMode&&s.upper===n.upper&&s.lower===n.lower&&s.direction===n.direction&&s.count===n.count&&s.changing===n.changing&&(s.kind!=="qimen"||s.qimenRule===n.qimenRule&&s.qLateZi===n.qLateZi)&&(s.kind!=="zeri"||s.task===n.task&&s.days===n.days&&s.shengXiao===n.shengXiao&&s.zCand===n.zCand)&&(s.kind!=="xiaoliuren"||s.xlrMode===n.xlrMode&&s.num1===n.num1&&s.num2===n.num2&&s.num3===n.num3)&&(s.kind!=="trend"||s.toAge===n.toAge)&&(s.kind!=="fengshui"||s.fsMode===n.fsMode&&s.fsPeriod===n.fsPeriod&&s.sitting===n.sitting&&s.facing===n.facing)&&(s.kind!=="name"||s.nnMode===n.nnMode&&s.surname===n.surname&&s.givenName===n.givenName&&s.limitN===n.limitN)&&(s.kind!=="convert"||s.convMode===n.convMode&&s.lunarDate===n.lunarDate&&!!s.leapMonth==!!n.leapMonth)&&(s.kind!=="hepan"||s.hpChart===n.hpChart&&s.partnerDate===n.partnerDate&&s.partnerTime===n.partnerTime&&s.partnerGender===n.partnerGender&&s.partnerAddress===n.partnerAddress&&!!s.thirdOn==!!n.thirdOn&&s.p2Date===n.p2Date&&s.p2Time===n.p2Time&&s.p2Gender===n.p2Gender&&s.p2Address===n.p2Address);function Ri(s,n){if(s==="bazi"){const D=["year","month","day","hour"].map(V=>n.pillars&&n.pillars[V]).filter(Boolean).map(V=>V.ganzhi).join(" ");return n.hourUnknown||n.pillars&&!n.pillars.hour?`${D}(时柱暂缺)`:D}return s==="ziwei"?`${n.soul?n.soul.branch:""}宫 ${n.bureau?n.bureau.name:""} ${n.lunar?n.lunar.year+"年":""}`.trim():s==="liuyao"?n.ben&&n.ben.name?n.ben.name:"":s==="meihua"?n.ben&&n.ben.name?`${n.ben.name} 动${n.moving}`:"":s==="daliuren"?`${n.dayGanZhi||""} ${n.geJu?n.geJu.name:""}`:""}const B=window.__PP,Lt=()=>typeof performance<"u"&&performance.now?performance.now():Date.now();let Re=0;const va=typeof window.__mpEnsureEngine=="function"?window.__mpEnsureEngine:async()=>window.Engine,Ii=`
|
|
1982
1994
|
/* 整个侧栏面板铺宣纸:暖白渐变为底 + feTurbulence 纤维噪点平铺。
|
|
1983
1995
|
background-attachment:local 让纹理跟着滚动内容走,长页面不会下半截露白。
|
|
1984
1996
|
噪点用 colorMatrix 压到很低的 alpha(0.09),只做纸感不糊字。 */
|
|
@@ -2216,11 +2228,11 @@ window.__ModuleLoader__.load({id:"dsh-metaphysics",version:"0.63.0",factory(Wt){
|
|
|
2216
2228
|
@media (prefers-reduced-motion:reduce){
|
|
2217
2229
|
*,*::before,*::after{transition-duration:.001ms!important;animation-duration:.001ms!important}
|
|
2218
2230
|
}
|
|
2219
|
-
`,{useState:
|
|
2231
|
+
`,{useState:C,useEffect:bt,useRef:Gi}=Tt,Ra=s=>String(s).padStart(2,"0");function Bi(s){const n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(s||""));if(!n)return!1;const q=Number(n[1]),D=Number(n[2]),V=Number(n[3]);if(D<1||D>12||V<1)return!1;const ie=[31,q%4===0&&q%100!==0||q%400===0?29:28,31,30,31,30,31,31,30,31,30,31];return V<=ie[D-1]}function Ia(s){const n=/^(\d{4})\s*[年./-]\s*(\d{1,2})\s*[月./-]\s*(\d{1,2})\s*日?$/.exec(String(s||"").trim());if(!n)return"";const q=`${n[1]}-${Ra(n[2])}-${Ra(n[3])}`;return Bi(q)?q:""}function Zi(s){const n=String(s||"").trim();if(/^\d{0,4}(-\d{0,2}){0,2}$/.test(n))return n;if(/[年月日/.]/.test(n)){const D=Ia(n);if(D)return D}const q=n.replace(/\D/g,"").slice(0,8);return q.length<=4?q:q.length<=6?`${q.slice(0,4)}-${q.slice(4)}`:`${q.slice(0,4)}-${q.slice(4,6)}-${q.slice(6)}`}function ya(s){const n=s.value||"",[q,D]=C(n),V=Gi(n);bt(()=>{V.current=n,D(n)},[n]);const te=()=>{const ie=q.trim();if(!ie){D(V.current),s.onInvalid&&s.onInvalid("");return}const oe=Ia(ie);if(oe){V.current=oe,D(oe),oe!==n&&s.onChange(oe);return}D(V.current),s.onInvalid&&s.onInvalid(ie)};return p("input",{className:"mp-input",type:"text",inputMode:"numeric",autoComplete:"off",placeholder:"年-月-日,如 1990-05-12",value:q,onChange:ie=>{D(Zi(ie.target.value))},onBlur:te,onKeyDown:ie=>{ie.key==="Enter"&&(ie.preventDefault(),te())}})}const Jt=4,Je=12;let Qt=null;function ea(){if(Qt)return Qt;let s=null;try{s=U.compute({system:"mbti"})}catch{s=null}const n=s&&s.questions||[];return n.length?(Qt={total:s&&s.total||n.length,questions:n,scale:s&&s.scale||{}},Qt):{total:0,questions:[],scale:{}}}function Ui(s){const{answers:n,page:q,onPick:D,onPage:V,onSubmit:te,onClear:ie}=s,oe=ea(),a=Math.max(1,Math.ceil(oe.total/Jt)),fe=q*Jt,ze=oe.questions.slice(fe,fe+Jt),O=n.filter(Z=>Z!=null).length,he=oe.total?Math.round(O/oe.total*100):0,xe=q>=a-1,G=O>=Je;return p("div",{className:"mp-quiz"},p("div",{className:"mp-quiz-top"},p("div",{className:"mp-quiz-bar","aria-hidden":"true"},p("i",{style:{width:he+"%"}})),p("span",{className:"mp-quiz-count"},`第 ${q+1} / ${a} 页 · 已答 ${O} / ${oe.total}`)),p("div",{className:"mp-quiz-list"},ze.map((Z,R)=>{const K=fe+R;return p("div",{key:Z.id||K,className:"mp-quiz-q"},p("div",{className:"mp-quiz-qt"},p("b",null,String(K+1).padStart(2,"0")),p("span",null,Z.text)),p("div",{className:"mp-quiz-opts",role:"radiogroup","aria-label":`第 ${K+1} 题`},[1,2,3,4,5].map(ve=>p("label",{key:ve,className:"mp-quiz-o"+(n[K]===ve?" on":"")},p("input",{type:"radio",name:`mpmbq${K}`,value:String(ve),checked:n[K]===ve,onChange:()=>D(K,ve)}),p("b",null,String(ve)),p("span",null,oe.scale[ve]||"")))))})),p("div",{className:"mp-quiz-nav"},p("button",{className:"mp-quiz-btn",disabled:q<=0,onClick:()=>V(-1)},"上一页"),xe?null:p("button",{className:"mp-quiz-btn",onClick:()=>V(1)},"下一页"),p("button",{className:"mp-quiz-btn primary",disabled:!G,onClick:te},"看结果"),p("button",{className:"mp-quiz-btn",onClick:ie},"清空"),p("span",{className:"mp-quiz-hint"},G?`已够 ${Je} 题,可以看结果;答完 ${oe.total} 题会更准。`:`答满 ${Je} 题可先看结果(还差 ${Je-O} 题)。`)))}class Ki extends(Tt.Component||Object){constructor(n){super(n),this.state={err:null}}static getDerivedStateFromError(n){return{err:n}}componentDidCatch(n,q){console.error("[metaphysics] 面板渲染异常",n,q)}render(){if(!this.state.err)return this.props.children;const n=this.state.err,q=String(n&&n.stack||"").split(`
|
|
2220
2232
|
`).slice(0,14).join(`
|
|
2221
|
-
`);return p("div",{className:"mp-wrap"},p("div",{className:"mp-panel"},p("div",{className:"mp-lbl"},"命理面板渲染出错——把下面这段发给我"),p("pre",{style:{whiteSpace:"pre-wrap",fontSize:12,lineHeight:1.5,maxHeight:320,overflow:"auto",margin:"8px 0"}},String(
|
|
2233
|
+
`);return p("div",{className:"mp-wrap"},p("div",{className:"mp-panel"},p("div",{className:"mp-lbl"},"命理面板渲染出错——把下面这段发给我"),p("pre",{style:{whiteSpace:"pre-wrap",fontSize:12,lineHeight:1.5,maxHeight:320,overflow:"auto",margin:"8px 0"}},String(n&&n.message||n)+`
|
|
2222
2234
|
|
|
2223
|
-
`+q),p("div",{className:"mp-lbl"},"环境:__PP "+typeof B+" · Engine "+typeof window.Engine+" · React "+typeof Lt+" · 版本 "+(typeof B=="object"&&B&&(window.__MP_VER||"?"))+((window.__MP_UNRELEASED||[]).length?" · 未发版改动 "+window.__MP_UNRELEASED.length+" 项":""))))}}function Ui(n){const s=n&&n.size?n.size:20,q=n&&n.active;return p("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":!0,style:{opacity:q?1:.72}},p("circle",{cx:12,cy:12,r:8.2}),p("path",{d:"M12 3.8a4.1 4.1 0 0 1 0 8.2 4.1 4.1 0 0 0 0 8.2"}),p("circle",{cx:12,cy:8,r:1.1,fill:"currentColor",stroke:"none"}),p("circle",{cx:12,cy:16,r:1.1,fill:"currentColor",stroke:"none"}))}const He=[{k:"ziwei",label:"紫微",timeLabel:"出生时刻",hint:"紫微斗数需要出生日期、时刻与性别;出生地只影响真太阳时修正。"},{k:"bazi",label:"八字",timeLabel:"出生时刻",hint:"四柱八字按节气与真太阳时定时柱,出生地越准,时柱越稳。"},{k:"liuyao",label:"六爻",timeLabel:"起卦时刻",hint:"六爻不需要出生时间:只用起卦当下的日辰定六神、月建定旺衰,卦由摇出。"},{k:"meihua",label:"梅花",timeLabel:"起卦时刻",hint:"梅花用起卦时刻的年月日时数成卦,也可直接给两个数字起卦;与出生时间无关。"},{k:"daliuren",label:"六壬",timeLabel:"起卦时刻",hint:"大六壬用起卦时刻的日干支、时支与月将起天地盘;同样与出生时间无关。"},{k:"qimen",label:"奇门",timeLabel:"起局时刻",hint:"奇门时家转盘:用起局时刻定节气、三元与局数;换局规则决定符头与节气如何对齐。"},{k:"hepan",label:"合盘",timeLabel:"你的出生时刻",hint:"合盘按「日主 + 夫妻宫 + 五行互补」看两个人的相处与互补,需要双方出生信息。"},{k:"tarot",label:"塔罗",timeLabel:"",hint:"塔罗不看时间,只记录抽牌时刻与你的提问。"},{k:"almanac",label:"黄历",timeLabel:"",hint:"黄历按公历日期查农历、干支、宜忌、时辰吉凶、二十八宿与吉神方位;只做本地计算。"},{k:"convert",label:"农历",timeLabel:"",hint:"公农历互转:公历生日可反查农历;只知道农历生日时,可转成公历再排盘。"},{k:"zeri",label:"择日",timeLabel:"",hint:"择日把区间内每天的建除宜忌与事项适配打分排序,并按属相排除冲煞日。"},{k:"chenggu",label:"称骨",timeLabel:"出生时刻",hint:"称骨按农历年、月、日、时的骨重求和;时辰必填。"},{k:"xiaoliuren",label:"小六壬",timeLabel:"起课时刻",hint:"小六壬用农历月/日/时掐指,也可用三个随机数起课。"},{k:"star",label:"星座",timeLabel:"",hint:"星座按公历日期给出太阳星座与当日基调;同日同星座结果固定。"},{k:"numerology",label:"生命数字",timeLabel:"",hint:"生命数字按公历生日归约出生命路径数、生日数与态度数。"},{k:"mbti",label:"人格",timeLabel:"",hint:"十六型人格是 24 道自我报告题的 MBTI 风格测算:4 题一页,按 1–5 打分,答满 12 题即可看结果;只作自我参照,不是官方量表。"},{k:"trend",label:"人生K线",timeLabel:"出生时刻",hint:"人生 K 线按大运与流年十神给逐年运势分,画成走势图。"},{k:"fengshui",label:"风水",timeLabel:"",hint:"风水看八宅命卦、大游年四吉四凶与流年九宫飞星;也可按坐向看门主灶倾向,或按运与坐向排玄空下卦盘。"},{k:"name",label:"起名",timeLabel:"",hint:"起名按八字喜用匹配字库五行,可评估现有名字或生成候选名。"}];function yt(n){return String(n).padStart(2,"0")}const ba=["almanac","convert","zeri","chenggu","xiaoliuren","star","numerology","trend","fengshui","name"],Ki=Array.isArray(window.__MPGroups)?window.__MPGroups:[],Ra="mp.recent.tabs",Ia="mp.first.view",Ga=3;function Ba(n){try{return JSON.parse(window.localStorage.getItem(n)||"null")}catch{return null}}function Za(n,s){try{window.localStorage.setItem(n,JSON.stringify(s))}catch{}}function Yi(n){const s=new Date(n);if(Number.isNaN(s.getTime()))return"";const q=V=>new Date(V.getFullYear(),V.getMonth(),V.getDate()).getTime(),P=Math.round((q(new Date)-q(s))/864e5);return P<=0?"今天":P===1?"昨天":`${yt(s.getMonth()+1)}-${yt(s.getDate())}`}function va(){const n=new Date;return{date:`${n.getFullYear()}-${yt(n.getMonth()+1)}-${yt(n.getDate())}`,time:`${yt(n.getHours())}:${yt(n.getMinutes())}`}}const Vi={ziwei:"birth",bazi:"birth",hepan:"birth",liuyao:"cast",meihua:"cast",daliuren:"cast",qimen:"cast",tarot:"none",almanac:"date",zeri:"date",star:"date",numerology:"date",convert:"date",chenggu:"birth",trend:"birth",fengshui:"birth",name:"birth",xiaoliuren:"cast",mbti:"none"},Ua={date:"1990-05-12",time:"14:30"},$t=n=>Vi[n]||"none",Me=window.__MPCore||{},Pe=Me.needAsk||(n=>!1),W={ref:null,seats:[],seatOk:{},seatDisposers:[],contribution:"",keys:"",injectType:"",spec:"",errs:[],regs:0,mounted:0},it={r:null,q:"",it:null};let Ve="";function Ka(){const n=[];return n.push("inputActions "+(W.ref?"已拿到":"未拿到")),n.push("渲染 "+W.mounted+" 次"),n.push("注册 "+W.regs+" 次"),n.push("inject "+(W.injectType||"?")),n.push("槽位 "+(W.spec||"?")),W.contribution&&n.push("贡献 "+W.contribution),W.errs.length&&n.push("错误:"+W.errs.join(" / ")),"桥自检:"+n.join(";")}function Ya(n){if(W.errs.length>=3)return;const s=n&&n.message?String(n.message):String(n);W.errs.push(s.slice(0,90))}function Xi(n){if(!n)return null;const s=n.inputActions;if(s&&typeof s.setDraft=="function"&&typeof s.submit=="function")return s;const q=n.actions&&n.actions.input;return q&&typeof q.setDraft=="function"&&typeof q.submit=="function"?q:null}function Va(n,s){const q=Xi(n);return vt(()=>{if(W.seats.indexOf(s)<0&&W.seats.push(s),W.keys=n?Object.keys(n).join(","):"",q){W.ref=q;try{window.__MPComposer=q}catch{}}return()=>{W.ref===q&&(W.ref=null)}},[q,s]),q}function Wi(){const n=it.r;if(!n)return"";try{const s=K.askPrompt?K.askPrompt(n,{question:it.q,interpret:it.it}):null;return s&&s.text||String(n.summary||"")}catch{return String(n.summary||"")}}function Xa(n){return W.mounted+=1,Va(n,"input.right")?p("button",{type:"button",className:"mp-chip ok",title:it.r?"把上一张盘的摘要和问题发进对话窗":"先在侧栏「命理」里排一张盘",onClick:()=>{const q=Wi();q&&Ja(q)}},"命理·问"):p("span",{className:"mp-chip warn",title:"命理:已占住输入框槽位,但没拿到 inputActions;把这句话告诉作者"},"命理·未就绪")}function Wa(n){return W.mounted+=1,Va(n,"composer.dock"),null}function Ja(n){let s=W.ref;if(!s)try{s=window.__MPComposer||null}catch{s=null}return!s||typeof s.setDraft!="function"||typeof s.submit!="function"?!1:(s.setDraft(n),s.submit(),!0)}function Ji(){const[n,s]=M("ziwei"),[q,P]=M("1990-05-12"),[V,ee]=M("14:30"),[ae,se]=M(!1),[a,ge]=M("female"),[ze,F]=M(""),[fe,he]=M("1992-08-15"),[G,Z]=M("10:00"),[R,Y]=M("female"),[ve,wt]=M(""),[nt,kt]=M("bazi"),[Se,_t]=M(!1),[Xe,$a]=M("1990-01-01"),[zt,jt]=M("12:00"),[Re,Ht]=M("male"),[st,Ot]=M(""),[qt,Ft]=M("chaibu"),[Oe,St]=M(!0),[ot,Nt]=M(!0),[Dt,Mt]=M("same-day"),[We,Pt]=M(!1),[Je,wa]=M(""),[Rt,Ce]=M(""),[Ie,Qe]=M(null),[It,et]=M({}),[rt,ta]=M(null),[pt,aa]=M([{year:"2019",kind:"career"},{year:"2022",kind:"love"}]),[tt,Gt]=M(null),[lt,ia]=M("开业"),[At,Ne]=M("30"),[Te,Ct]=M(""),[Ge,Bt]=M(""),[Be,Zt]=M("solar2lunar"),[dt,e]=M(""),[i,r]=M(!1),[l,o]=M("time"),[c,d]=M(""),[m,u]=M(""),[h,b]=M(""),[C,S]=M(()=>new Array(ea().total).fill(null)),[T,j]=M(0),[_,X]=M("60"),[H,w]=M("natal"),[z,te]=M("9"),[D,oe]=M("子"),[$,ce]=M("午"),[k,O]=M("assess"),[Q,$e]=M("李"),[ue,pe]=M(""),[me,Fe]=M("6"),[Ze,ct]=M(!1),[be,L]=M(""),[f,U]=M(null),[de,re]=M(""),[x,v]=M(""),[le,ie]=M(null),[ke,we]=M(()=>Oi()),[xe,mt]=M(()=>Ba(Ia)==="flat"?"flat":"group"),[ut,ka]=M(()=>{const t=Ba(Ra);return Array.isArray(t)?t:[]}),[an,nn]=M({}),[za,ei]=M(null),[ti,na]=M(()=>B.profilesLoad()),[Ut,sa]=M(null),[ai,ii]=M(""),[gt,Ue]=M(""),[ni,Ae]=M(""),[sn,oa]=M(!1),[ja,si]=M("3"),[at,qa]=M(""),[Le,oi]=M("general");function Sa(){return Je.trim()||(f&&Pe(f.kind)?String(at||"").trim():"")}vt(()=>{f&&f.r&&(it.r=f.r,it.q=Sa(),it.it=f.it||null)},[f,Je,at]);const[ri,on]=M(null),[rn,ra]=M(!1),[ft,pi]=M("time"),[pa,li]=M(""),[la,di]=M(""),[da,ci]=M(""),[pn,ht]=M(""),[Na,ca]=M({birth:null,cast:null}),ln=He.find(t=>t.k===n)||He[0],Kt=n==="bazi"||n==="ziwei"||n==="hepan"||n==="chenggu"||n==="trend"||n==="fengshui"||n==="name",Ee=$t(n),mi=!(n==="meihua"&&ft==="number"),ui=n!=="tarot"&&n!=="mbti"&&mi,gi=ui&&Ee!=="date",Xn=gi,je=async(t,g,N,E)=>{const y=t||n,ne=N||ft,ye=y==="bazi"||y==="trend",Ke=E&&typeof E.hourUnknown=="boolean"?E.hourUnknown:ae,qe=g||(ye&&Ke?{date:q,time:"12:00"}:{date:q,time:V}),_e=E&&E.gender?E.gender:a,xt=E&&typeof E.address=="string"?E.address:ze,Yt=E&&typeof E.trueSolar=="boolean"?E.trueSolar:Oe,Vt=E&&typeof E.lateZi=="boolean"?E.lateZi:ot,qi=E&&typeof E.lines=="string"?E.lines:be,ua=E&&typeof E.question=="string"?E.question:at,Si=Et(),Ni=++De,Xt=()=>Ni!==De;ie(null),Ae("");try{let bt=0,Mi=null;oa(!0);try{await ha(y);const I=window.__MP_LAST_LOAD;bt=I&&typeof I.ms=="number"?I.ms:Et()-Si,Mi=I&&typeof I.cached=="boolean"?I.cached:null}catch(I){if(Xt())return;Ue(I&&I.message?I.message:String(I)),U(null);return}finally{Xt()||oa(!1)}if(Xt())return;const Ai=`${qe.date}T${qe.time}`,A={system:y};if(A.shadow=y!=="mbti",A.trace=y==="liuyao"||y==="bazi"||y==="ziwei"||y==="qimen"||y==="daliuren",y!=="tarot"&&(A.datetime=Ai),y==="bazi"||y==="ziwei"||y==="hepan"||y==="trend"){if(A.gender=_e,A.trueSolar=Yt,xt.trim()){A.address=xt.trim();try{const I=await K.geocodeAddress(A.address,{online:Ze});I&&typeof I.lon=="number"&&(A.longitude=I.lon,A.geo=I)}catch(I){console.error("[metaphysics] 地址解析失败,退回内置表",I)}if(Xt())return}(y==="bazi"||y==="ziwei")&&(A.cross=We),A.lateZi=Vt,ye&&Ke&&(A.hourUnknown=!0)}if(y==="liuyao"){const I=Me.parseLines(qi);I.lines?A.lines=I.lines:I.warning&&Ae(I.warning)}if(y==="qimen"&&(A.juMethod=qt,A.lateZiHourMode=Dt,A.direction=Le),y==="bazi"&&(A.verifyPast=6),y==="zeri"){A.startDate=qe.date,A.task=lt,A.days=Number(At)||30,Te&&(A.shengXiao=Te);const I=Ge.split(/[,,、\s]+/).filter(Boolean);I.length&&(A.candidates=I)}if(y==="xiaoliuren")if(A.mode=l,l==="number")A.num1=Number(c)||void 0,A.num2=Number(m)||void 0,A.num3=Number(h)||void 0;else{A.date=qe.date;const I=Number(String(qe.time).split(":")[0]);A.hour=Number.isFinite(I)?I:12}if(y==="mbti"){delete A.datetime;const I=C.slice();for(;I.length&&I[I.length-1]==null;)I.pop();I.length&&(A.answers=I)}if(y==="trend"&&ye&&Ke&&(A.hourUnknown=!0),y==="trend"&&(A.toAge=Number(_)||60),y==="fengshui"&&(A.action=H,H==="natal"?A.gender=_e:(A.sitting=D,A.facing=$,delete A.datetime,H==="xuankong"&&(A.period=Number(z)||9))),y==="name"&&(A.action=k,A.surname=Q.trim(),k==="generate"?(A.gender=_e,A.limit=Number(me)||6,A.trueSolar=Yt,A.lateZi=Vt):(A.givenName=ue.trim(),(!qe.date||!qe.time)&&delete A.datetime)),y==="convert")if(A.system="convert",Be==="lunar2solar"){const I=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(String(dt).trim());if(!I){Ue("农历转公历请按「农历年-月-日」填写,例如 2026-9-17;闰月单独勾选。");return}A.mode="lunar2solar",A.lunarYear=Number(I[1]),A.lunarMonth=Number(I[2]),A.lunarDay=Number(I[3]),A.isLeapMonth=i,delete A.datetime}else A.mode="solar2lunar";if(y==="tarot"&&(A.count=Number(ja)),y==="hepan"&&(A.chart=nt,A.partner={datetime:`${fe}T${G}`,gender:R,address:ve.trim()||void 0,trueSolar:Oe},Se&&(A.partner2={datetime:`${Xe}T${zt}`,gender:Re,address:st.trim()||void 0,trueSolar:Oe})),Pe(y)){if(!ua.trim()){Ue("请先填写「所问之事」——一句话即可,例如:今年是否适合换工作?"),ra(!0),U(null);return}ra(!1),A.question=ua.trim(),y==="liuyao"&&(A.direction=Le)}if(y==="meihua"&&(A.mode=ne,ne==="number")){if(pa.trim()===""||la.trim()===""){Ue("数字起卦需要填两个数(第一个数定上卦、第二个数定下卦)。"),U(null);return}if(A.upper=Number(pa),A.lower=Number(la),!Number.isFinite(A.upper)||!Number.isFinite(A.lower)){Ue("两个数都要是数字,例如 17 和 29。"),U(null);return}da!==""&&(A.changing=Number(da))}const Bn=Et();y==="trend"&&!A.asOf&&Me.todayStamp&&(A.asOf=Me.todayStamp());const Tt=K.compute(A),Zn=Et()-Bn;let Aa=null;try{Aa=B.shadowTrack?B.shadowTrack(Tt):null}catch{Aa=null}let Ca=null;if(y==="bazi")try{Ca=K.compute({system:"trend",datetime:Ai,gender:_e,toAge:100,trueSolar:Yt,lateZi:Vt,...Me.todayStamp?{asOf:A.asOf||Me.todayStamp()}:{},...A.dst!==void 0?{dst:A.dst}:{},...A.address?{address:A.address}:{},...typeof A.longitude=="number"?{longitude:A.longitude}:{},...A.geo?{geo:A.geo}:{}})}catch{Ca=null}let Ta=null;if(K.caliberCompare)try{Ta=K.caliberCompare(A)}catch{Ta=null}const Un=Pe(y)||y==="qimen"?{question:Pe(y)?ua.trim():"",direction:Le}:void 0,ga=K.interpret?K.interpret(Tt,Un):null;ga&&Tt.cross&&K.crossSection&&(ga.sections=[...ga.sections||[],K.crossSection(Tt.cross)]);const Kn=$t(y)==="cast"&&(y!=="meihua"||ne==="time");U({kind:y,r:Tt,it:ga,at:qe,timed:Kn,trend:Ca,caliber:Ta,shadowDiff:Aa,gender:_e,address:xt,trueSolar:Yt,lateZi:Vt});const Ci=I=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>I>1?Ci(I-1):Ti()):setTimeout(Ti,0)},Ti=()=>{Ni===De&&ie({engineMs:bt,computeMs:Zn,cached:Mi,totalMs:Et()-Si,renderMs:null})};if(Ci(2),Qe(null),ta(null),et({}),Gt(null),Ue(""),ht(""),y!=="tarot"&&y!=="mbti"){const I=!!(ye&&Ke),Li={kind:y,date:qe.date,time:I?"":qe.time,hourUnknown:I,gender:_e,address:xt,trueSolar:Yt,lateZi:Vt,lines:y==="liuyao"?qi:"",question:Pe(y)?ua.trim():"",direction:Le,count:ja,mhMode:ne,upper:pa,lower:la,changing:da,...y==="qimen"?{qimenRule:qt,qLateZi:Dt}:{},...y==="zeri"?{task:lt,days:At,shengXiao:Te,zCand:Ge}:{},...y==="xiaoliuren"?{xlrMode:l,num1:c,num2:m,num3:h}:{},...y==="trend"?{toAge:_}:{},...y==="fengshui"?{fsMode:H,fsPeriod:z,sitting:D,facing:$}:{},...y==="name"?{nnMode:k,surname:Q,givenName:ue,limitN:me}:{},...y==="convert"?{convMode:Be,lunarDate:dt,leapMonth:i}:{},...y==="hepan"?{hpChart:nt,partnerDate:fe,partnerTime:G,partnerGender:R,partnerAddress:ve,thirdOn:Se,p2Date:Xe,p2Time:zt,p2Gender:Re,p2Address:st}:{},label:Di(y,Tt),at:Date.now()};we(Yn=>{const Ei=[Li,...Yn.filter(Vn=>!Fi(Vn,Li))].slice(0,20);return Fa(Ei),Ei})}}catch(bt){if(Xt())return;Ue(bt&&bt.message?bt.message:String(bt)),U(null)}},dn=async t=>{const g=$t(t),N=++De;if(Ue(""),t==="mbti"){Ae(""),oa(!0);try{await ha(t)}catch(y){N===De&&Ue(y&&y.message?y.message:String(y))}finally{N===De&&oa(!1)}if(N!==De)return;s(t),C.filter(y=>y!=null).length>=Ye?je(t):U(null);return}if(s(t),g==="none"){je(t);return}const E=Na[g]||(g==="cast"||g==="date"?va():{date:Ua.date,time:Ua.time});P(E.date),ee(E.time),je(t,E)},cn=t=>{He.some(g=>g.k===t)&&ka(g=>{const N=(g||[]).filter(y=>y&&y.tab&&y.tab!==t),E=[{tab:t,at:Date.now()}].concat(N).slice(0,Ga);return Za(Ra,E),E})},fi=t=>{const g=t==="flat"?"flat":"group";mt(g),Za(Ia,g)},Ma=t=>{cn(t),dn(t)},mn=t=>{P(t),Ee!=="none"&&ca(g=>Object.assign({},g,{[Ee]:{date:t,time:V}}))},un=t=>{ee(t),Ee!=="none"&&ca(g=>Object.assign({},g,{[Ee]:{date:q,time:t}}))},Wn=()=>{const t=va();P(t.date),ee(t.time),Ee!=="none"&&ca(g=>Object.assign({},g,{[Ee]:null})),je(n,t)},hi=()=>{if(n==="mbti"){const t=C.filter(g=>g!=null).length;if(t<Ye){Ae(`先答满 ${Ye} 题再看结果(现答 ${t} 题,还差 ${Ye-t} 题)。`);return}je(n);return}if(Ee!=="none"&&!Na[Ee]){const t=va();P(t.date),ee(t.time),je(n,t);return}je(n)},gn=()=>{const t={date:"1990-05-12",time:"14:30"};s("bazi"),ge("male"),F("河北石家庄"),ca(g=>Object.assign({},g,{birth:t})),P(t.date),ee(t.time),je("bazi",t,null,{gender:"male",address:"河北石家庄"})},xi=t=>{pi(t),je(n,{date:q,time:V},t)},fn=()=>!!(window.matchMedia&&window.matchMedia("(max-width: 640px)").matches),hn=()=>ri===null?fn():ri,ma=(t,g,N)=>{if(!g)return;const E=ne=>{t.textContent=ne?"已复制":"复制失败",setTimeout(()=>{t.textContent=N},1400)},y=()=>{try{const ne=document.createElement("textarea");ne.value=g,ne.setAttribute("readonly",""),ne.style.position="fixed",ne.style.opacity="0",document.body.appendChild(ne),ne.select();const ye=!!(document.execCommand&&document.execCommand("copy"));return document.body.removeChild(ne),ye}catch{return!1}};try{if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(g).then(()=>E(!0),()=>E(y()));return}}catch{}E(y())},xn=t=>ma(t,t.getAttribute("data-shadow-copy")||"","复制 ID"),bn=t=>ma(t,t.getAttribute("data-handle-copy")||"","复制句柄"),vn=t=>{const g=t.closest(".mp-trace-layer")||document.getElementById("mp-trace-layer"),N=g&&g.querySelector("[data-trace-md]");ma(t,N?N.value:"","复制 Markdown")},yn=()=>{try{return String(location.href).split("#")[0]}catch{return""}},$n=()=>{if(!f||!f.r)return null;try{return K.askPackages?K.askPackages(f.r,{question:Sa(),interpret:f.it,base:yn()}):null}catch{return null}},bi=[["full","复制提问","完整提问:盘面摘要 + 阅读层次 + 回答骨架,粘进任何对话窗都能用"],["brief","复制精简","一句话版:体系 + 排盘句柄 + 你的问题,够助手认出是哪张盘"],["structured","复制参数","结构化参数(JSON):助手可直接照 args 调 compute,不必解析自然语言"],["link","复制深链","深链:把这张盘的参数编进链接,打开即还原同一张盘(换台机器、发给朋友都行)"]],wn=(t,g)=>{const N=$n();if(!N){Ce("还没有可以复制的盘:先排一张。");return}const E=t==="link"?N.link:N[t];if(!E){Ce(t==="link"?"这张盘没拿到句柄(随机抽牌只复现参数、不复现牌面),深链做不出来;用「复制提问」那一档。":"这一档暂时是空的,换一档试试。");return}ma(g,E,bi.find(y=>y[0]===t)[1]),t==="link"&&Ce("深链已复制:打开就还原这张盘,也可以直接发给别人。链接里是编码不是加密,别公开贴。")},kn=()=>{const t=document.getElementById("mp-trace-layer");if(!t)return;t.classList.add("open"),t.setAttribute("aria-hidden","false");const g=t.querySelector("[data-trace-close]");g&&g.focus&&g.focus()},vi=()=>{const t=document.getElementById("mp-trace-layer");if(!t)return;t.classList.remove("open"),t.setAttribute("aria-hidden","true");const g=document.querySelector("[data-trace-open]");g&&g.focus&&g.focus()},zn=t=>{const g=t.target&&t.target.closest?t.target.closest("[data-shadow-copy]"):null;if(g){xn(g);return}const N=t.target&&t.target.closest?t.target.closest("[data-handle-copy]"):null;if(N){bn(N);return}if(t.target&&t.target.closest?t.target.closest("[data-trace-open]"):null){kn();return}const y=t.target&&t.target.closest?t.target.closest("[data-trace-copy]"):null;if(y){vn(y);return}if(t.target&&t.target.closest?t.target.closest("[data-mp-askcopy]"):null){Sn();return}if(t.target&&t.target.closest?t.target.closest("[data-trace-close]"):null){vi();return}const Ke=t.target&&t.target.closest?t.target.closest(".mp-it-head"):null;if(!Ke)return;const qe=Ke.closest(".mp-it");if(!qe)return;const _e=!qe.classList.contains("folded");qe.classList.toggle("folded",_e),Ke.setAttribute("aria-expanded",_e?"false":"true");const xt=Ke.querySelector(".mp-it-hint");xt&&(xt.textContent=_e?"点击展开":"点击收起"),on(_e)},yi=(t,g)=>{if(!f||!(Pe(n)||n==="qimen"))return;const N={question:Pe(n)?(g===void 0?at:g).trim():"",direction:t===void 0?Le:t},E=K.interpret?K.interpret(f.r,N):null;let y=f.r;if((n==="liuyao"||n==="qimen")&&y&&y.trace&&K.buildTrace)try{const ne=n==="liuyao"?K.buildTrace(y,{direction:N.direction,gender:y.useGod&&y.useGod.gender||"male",refresh:!0}):K.buildTrace(y,{direction:N.direction});ne&&(y=Object.assign({},y,{trace:ne}))}catch{}U(Object.assign({},f,{r:y,it:E}))},jn=t=>!t||!t.timed||!t.at?"":`<div class="mp-cast">起卦时刻:<b>${t.at.date} ${t.at.time}</b> (来自你的本机时间,点「此刻」可重新取当下)</div>`,qn=()=>{try{const t=f&&f.r&&f.r.summary?f.r.summary:"";if(!t)return;navigator.clipboard.writeText(t).then(()=>ht("已复制"),()=>ht("复制失败"))}catch{ht("复制失败")}},Sn=()=>{if(!f||!f.r||!window.Engine||!window.Engine.buildEventPrompt)return;const t=Me&&Me.kindOfDirection?Me.kindOfDirection(Le):"other";let g;try{g=window.Engine.buildEventPrompt(f.r,{question:(at||"").trim(),kind:t,gender:a,timeKnown:!0})}catch{g=null}g&&g.text&&navigator.clipboard.writeText(g.text).then(()=>ht("已复制问事提示"),()=>ht("复制失败"))},$i=()=>{if(!(!f||!f.r||!Je.trim()))try{Qe(K.followup?K.followup(f.r,Je.trim()):null)}catch(t){Qe({question:Je.trim(),ok:!1,answer:"追问失败:"+(t&&t.message?t.message:t),evidence:[],confidence:"弱"})}},Nn=()=>{if(!(!f||!f.r))try{const t=K.askPrompt?K.askPrompt(f.r,{question:Sa(),interpret:f.it}):null,g=t&&t.text?t.text:String(f.r.summary||"");if(Ja(g)){Ce("已发到对话窗,往下看回复。");return}const N="("+Ka()+")";navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(g).then(()=>Ce("对话输入框还没就绪"+N+",已复制提问;粘进对话窗回车即可。"),()=>Ce("对话输入框还没就绪"+N+",复制也没成功;先点「复制文字结果」再贴。")):Ce("对话输入框还没就绪"+N+";先点「复制文字结果」再贴进对话窗。")}catch(t){Ce("发到对话窗失败:"+(t&&t.message?t.message:t))}},Mn=()=>{const t=[],g=window.__MP_VER||"未知";t.push("# 命理插件反馈"),t.push(""),t.push("## 我遇到的情况"),t.push(""),t.push("(在这里写一句就好:哪里不对 / 读不懂哪一段 / 算得和别人不一样 / 想加什么。下面这些是自动带的复现信息,不用改。)"),t.push(""),t.push("## 复现信息"),t.push(""),t.push("- 插件版本:v"+g);{const y=Array.isArray(window.__MP_UNRELEASED)?window.__MP_UNRELEASED:[];y.length&&t.push("- 未发版改动:"+y.length+" 项(版本号未变,说明这份产物比 v"+g+" 新)")}const N=He.find(y=>y.k===n)?.label||n;if(t.push("- 体系:"+N+(N===n?"":"("+n+")")),at&&t.push("- 所问之事:"+at),Le&&Le!=="general"){const y=(Array.isArray(K.DIRECTIONS)?K.DIRECTIONS:[]).find(ne=>ne.key===Le);t.push("- 询问方向:"+(y?y.label:Le))}t.push(""),t.push("### 输入"),t.push(""),t.push("```"),($t(n)==="time"||$t(n)==="date")&&(t.push(`日期:${q}`),$t(n)==="time"&&t.push(`时刻:${ae?"(未知,按三柱排)":V}`),t.push(`性别:${a==="male"?"男":"女"}`),ze&&t.push(`出生地:${ze}`),t.push(`真太阳时:${Oe?"开":"关"} 晚子时换日:${ot?"开":"关"}`),n==="qimen"&&t.push(`奇门取局:${qt}`),We&&t.push("交叉验证:开"));const E={合盘:()=>{t.push(`对方:${fe} ${G} ${R==="male"?"男":"女"}${ve?" "+ve:""}(${nt} 盘)`),Se&&t.push(`第三方:${Xe} ${zt} ${Re==="male"?"男":"女"}${st?" "+st:""}`)},择日:()=>{t.push(`事项:${lt} 起算:${q} 天数:${At}${Te?" 属相:"+Te:""}${Ge?" 候选日:"+Ge:""}`)},起名:()=>{t.push(`姓:${Q||"(未填)"} 名:${ue||"(未填)"} 模式:${k}${k==="generate"?" 候选数:"+(me||"默认"):""}`)},公农历:()=>{t.push(`模式:${Be}${dt?" 农历输入:"+dt:""}${i?"(闰月)":""}`)},小六壬:()=>{t.push(`模式:${l}${l==="number"?` 报数:${c}/${m}/${h}`:""}`)},风水:()=>{t.push(`动作:${H}${H==="natal"?"":` 坐:${D} 向:${$}`}${H==="xuankong"?` 运:${z}`:""}`)}};if(E[N]&&E[N](),t.push("```"),t.push(""),gt&&(t.push("### 报错原文"),t.push(""),t.push("```"),t.push(String(gt)),t.push("```"),t.push("")),f&&f.r){t.push("### 结果摘要(引擎原文,前 40 行)"),t.push(""),t.push("```");const y=String(f.r.summary||(K.renderText?K.renderText(f.r):"")||"");t.push(y.split(`
|
|
2235
|
+
`+q),p("div",{className:"mp-lbl"},"环境:__PP "+typeof B+" · Engine "+typeof window.Engine+" · React "+typeof Tt+" · 版本 "+(typeof B=="object"&&B&&(window.__MP_VER||"?"))+((window.__MP_UNRELEASED||[]).length?" · 未发版改动 "+window.__MP_UNRELEASED.length+" 项":""))))}}function Yi(s){const n=s&&s.size?s.size:20,q=s&&s.active;return p("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":!0,style:{opacity:q?1:.72}},p("circle",{cx:12,cy:12,r:8.2}),p("path",{d:"M12 3.8a4.1 4.1 0 0 1 0 8.2 4.1 4.1 0 0 0 0 8.2"}),p("circle",{cx:12,cy:8,r:1.1,fill:"currentColor",stroke:"none"}),p("circle",{cx:12,cy:16,r:1.1,fill:"currentColor",stroke:"none"}))}const He=[{k:"ziwei",label:"紫微",timeLabel:"出生时刻",hint:"紫微斗数需要出生日期、时刻与性别;出生地只影响真太阳时修正。"},{k:"bazi",label:"八字",timeLabel:"出生时刻",hint:"四柱八字按节气与真太阳时定时柱,出生地越准,时柱越稳。"},{k:"liuyao",label:"六爻",timeLabel:"起卦时刻",hint:"六爻不需要出生时间:只用起卦当下的日辰定六神、月建定旺衰,卦由摇出。"},{k:"meihua",label:"梅花",timeLabel:"起卦时刻",hint:"梅花用起卦时刻的年月日时数成卦,也可直接给两个数字起卦;与出生时间无关。"},{k:"daliuren",label:"六壬",timeLabel:"起卦时刻",hint:"大六壬用起卦时刻的日干支、时支与月将起天地盘;同样与出生时间无关。"},{k:"qimen",label:"奇门",timeLabel:"起局时刻",hint:"奇门时家转盘:用起局时刻定节气、三元与局数;换局规则决定符头与节气如何对齐。"},{k:"hepan",label:"合盘",timeLabel:"你的出生时刻",hint:"合盘按「日主 + 夫妻宫 + 五行互补」看两个人的相处与互补,需要双方出生信息。"},{k:"tarot",label:"塔罗",timeLabel:"",hint:"塔罗不看时间,只记录抽牌时刻与你的提问。"},{k:"almanac",label:"黄历",timeLabel:"",hint:"黄历按公历日期查农历、干支、宜忌、时辰吉凶、二十八宿与吉神方位;只做本地计算。"},{k:"convert",label:"农历",timeLabel:"",hint:"公农历互转:公历生日可反查农历;只知道农历生日时,可转成公历再排盘。"},{k:"zeri",label:"择日",timeLabel:"",hint:"择日把区间内每天的建除宜忌与事项适配打分排序,并按属相排除冲煞日。"},{k:"chenggu",label:"称骨",timeLabel:"出生时刻",hint:"称骨按农历年、月、日、时的骨重求和;时辰必填。"},{k:"xiaoliuren",label:"小六壬",timeLabel:"起课时刻",hint:"小六壬用农历月/日/时掐指,也可用三个随机数起课。"},{k:"star",label:"星座",timeLabel:"",hint:"星座按公历日期给出太阳星座与当日基调;同日同星座结果固定。"},{k:"numerology",label:"生命数字",timeLabel:"",hint:"生命数字按公历生日归约出生命路径数、生日数与态度数。"},{k:"mbti",label:"人格",timeLabel:"",hint:"十六型人格是 24 道自我报告题的 MBTI 风格测算:4 题一页,按 1–5 打分,答满 12 题即可看结果;只作自我参照,不是官方量表。"},{k:"trend",label:"人生K线",timeLabel:"出生时刻",hint:"人生 K 线按大运与流年十神给逐年运势分,画成走势图。"},{k:"fengshui",label:"风水",timeLabel:"",hint:"风水看八宅命卦、大游年四吉四凶与流年九宫飞星;也可按坐向看门主灶倾向,或按运与坐向排玄空下卦盘。"},{k:"name",label:"起名",timeLabel:"",hint:"起名按八字喜用匹配字库五行,可评估现有名字或生成候选名。"}];function vt(s){return String(s).padStart(2,"0")}const $a=["almanac","convert","zeri","chenggu","xiaoliuren","star","numerology","trend","fengshui","name"],Vi=Array.isArray(window.__MPGroups)?window.__MPGroups:[],Ga="mp.recent.tabs",Ba="mp.first.view",Za=3;function Ua(s){try{return JSON.parse(window.localStorage.getItem(s)||"null")}catch{return null}}function Ka(s,n){try{window.localStorage.setItem(s,JSON.stringify(n))}catch{}}function Xi(s){const n=new Date(s);if(Number.isNaN(n.getTime()))return"";const q=V=>new Date(V.getFullYear(),V.getMonth(),V.getDate()).getTime(),D=Math.round((q(new Date)-q(n))/864e5);return D<=0?"今天":D===1?"昨天":`${vt(n.getMonth()+1)}-${vt(n.getDate())}`}function wa(){const s=new Date;return{date:`${s.getFullYear()}-${vt(s.getMonth()+1)}-${vt(s.getDate())}`,time:`${vt(s.getHours())}:${vt(s.getMinutes())}`}}const Wi={ziwei:"birth",bazi:"birth",hepan:"birth",liuyao:"cast",meihua:"cast",daliuren:"cast",qimen:"cast",tarot:"none",almanac:"date",zeri:"date",star:"date",numerology:"date",convert:"date",chenggu:"birth",trend:"birth",fengshui:"birth",name:"birth",xiaoliuren:"cast",mbti:"none"},Ya={date:"1990-05-12",time:"14:30"},yt=s=>Wi[s]||"none",Ne=window.__MPCore||{},Ie=Ne.needAsk||(s=>!1),W={ref:null,seats:[],seatOk:{},seatDisposers:[],contribution:"",keys:"",injectType:"",spec:"",errs:[],regs:0,mounted:0},st={r:null,q:"",it:null};let Qe="";function Va(){const s=[];return s.push("inputActions "+(W.ref?"已拿到":"未拿到")),s.push("渲染 "+W.mounted+" 次"),s.push("注册 "+W.regs+" 次"),s.push("inject "+(W.injectType||"?")),s.push("槽位 "+(W.spec||"?")),W.contribution&&s.push("贡献 "+W.contribution),W.errs.length&&s.push("错误:"+W.errs.join(" / ")),"桥自检:"+s.join(";")}function Xa(s){if(W.errs.length>=3)return;const n=s&&s.message?String(s.message):String(s);W.errs.push(n.slice(0,90))}function Ji(s){if(!s)return null;const n=s.inputActions;if(n&&typeof n.setDraft=="function"&&typeof n.submit=="function")return n;const q=s.actions&&s.actions.input;return q&&typeof q.setDraft=="function"&&typeof q.submit=="function"?q:null}function Wa(s,n){const q=Ji(s);return bt(()=>{if(W.seats.indexOf(n)<0&&W.seats.push(n),W.keys=s?Object.keys(s).join(","):"",q){W.ref=q;try{window.__MPComposer=q}catch{}}return()=>{W.ref===q&&(W.ref=null)}},[q,n]),q}function Qi(){const s=st.r;if(!s)return"";try{const n=U.askPrompt?U.askPrompt(s,{question:st.q,interpret:st.it}):null;return n&&n.text||String(s.summary||"")}catch{return String(s.summary||"")}}function Ja(s){return W.mounted+=1,Wa(s,"input.right")?p("button",{type:"button",className:"mp-chip ok",title:st.r?"把上一张盘的摘要和问题发进对话窗":"先在侧栏「命理」里排一张盘",onClick:()=>{const q=Qi();q&&ei(q)}},"命理·问"):p("span",{className:"mp-chip warn",title:"命理:已占住输入框槽位,但没拿到 inputActions;把这句话告诉作者"},"命理·未就绪")}function Qa(s){return W.mounted+=1,Wa(s,"composer.dock"),null}function ei(s){let n=W.ref;if(!n)try{n=window.__MPComposer||null}catch{n=null}return!n||typeof n.setDraft!="function"||typeof n.submit!="function"?!1:(n.setDraft(s),n.submit(),!0)}function en(){const[s,n]=C("ziwei"),[q,D]=C("1990-05-12"),[V,te]=C("14:30"),[ie,oe]=C(!1),[a,fe]=C("female"),[ze,O]=C(""),[he,xe]=C("1992-08-15"),[G,Z]=C("10:00"),[R,K]=C("female"),[ve,$t]=C(""),[Ge,Et]=C("bazi"),[Oe,_t]=C(!1),[Be,Ht]=C("1990-01-01"),[et,za]=C("12:00"),[wt,kt]=C("male"),[Fe,Ot]=C(""),[zt,Ft]=C("chaibu"),[Ze,ot]=C(!0),[tt,jt]=C(!0),[Dt,ta]=C("same-day"),[Pt,Rt]=C(!1),[Ce,It]=C(""),[aa,Ae]=C(""),[Gt,Bt]=C(null),[De,rt]=C({}),[pt,at]=C(null),[qt,ia]=C([{year:"2019",kind:"career"},{year:"2022",kind:"love"}]),[Ue,Zt]=C(null),[St,na]=C("开业"),[lt,sa]=C("30"),[it,Se]=C(""),[Pe,Nt]=C(""),[Te,Mt]=C("solar2lunar"),[dt,oa]=C(""),[Ct,e]=C(!1),[i,r]=C("time"),[l,o]=C(""),[c,d]=C(""),[m,u]=C(""),[f,x]=C(()=>new Array(ea().total).fill(null)),[E,S]=C(0),[L,j]=C("60"),[M,J]=C("natal"),[P,w]=C("9"),[z,ae]=C("子"),[F,pe]=C("午"),[$,me]=C("assess"),[k,H]=C("李"),[ee,$e]=C(""),[ue,de]=C("6"),[ge,Ke]=C(!1),[Ye,Ve]=C(""),[b,A]=C(null),[X,Y]=C(""),[ce,re]=C(""),[h,y]=C(null),[le,ne]=C(()=>Di()),[be,we]=C(()=>Ua(Ba)==="flat"?"flat":"group"),[ke,ct]=C(()=>{const t=Ua(Ga);return Array.isArray(t)?t:[]}),[mt,ja]=C({}),[qa,ai]=C(null),[ii,ra]=C(()=>B.profilesLoad()),[Ut,pa]=C(null),[ni,si]=C(""),[ut,Xe]=C(""),[oi,Me]=C(""),[sn,la]=C(!1),[Sa,ri]=C("3"),[nt,Na]=C(""),[Le,pi]=C("general");function Ma(){return Ce.trim()||(b&&Ie(b.kind)?String(nt||"").trim():"")}bt(()=>{b&&b.r&&(st.r=b.r,st.q=Ma(),st.it=b.it||null)},[b,Ce,nt]);const[li,on]=C(null),[rn,da]=C(!1),[gt,di]=C("time"),[ca,ci]=C(""),[ma,mi]=C(""),[ua,ui]=C(""),[pn,ft]=C(""),[Ca,ga]=C({birth:null,cast:null}),ln=He.find(t=>t.k===s)||He[0],Kt=s==="bazi"||s==="ziwei"||s==="hepan"||s==="chenggu"||s==="trend"||s==="fengshui"||s==="name",Ee=yt(s),gi=!(s==="meihua"&>==="number"),fi=s!=="tarot"&&s!=="mbti"&&gi,hi=fi&&Ee!=="date",Xn=hi,je=async(t,g,N,_)=>{const v=t||s,se=N||gt,ye=v==="bazi"||v==="trend",We=_&&typeof _.hourUnknown=="boolean"?_.hourUnknown:ie,qe=g||(ye&&We?{date:q,time:"12:00"}:{date:q,time:V}),_e=_&&_.gender?_.gender:a,ht=_&&typeof _.address=="string"?_.address:ze,Yt=_&&typeof _.trueSolar=="boolean"?_.trueSolar:Ze,Vt=_&&typeof _.lateZi=="boolean"?_.lateZi:tt,Ni=_&&typeof _.lines=="string"?_.lines:Ye,ha=_&&typeof _.question=="string"?_.question:nt,Mi=Lt(),Ci=++Re,Xt=()=>Ci!==Re;y(null),Me("");try{let xt=0,Ai=null;la(!0);try{await va(v);const I=window.__MP_LAST_LOAD;xt=I&&typeof I.ms=="number"?I.ms:Lt()-Mi,Ai=I&&typeof I.cached=="boolean"?I.cached:null}catch(I){if(Xt())return;Xe(I&&I.message?I.message:String(I)),A(null);return}finally{Xt()||la(!1)}if(Xt())return;const Ti=`${qe.date}T${qe.time}`,T={system:v};if(T.shadow=v!=="mbti",T.trace=v==="liuyao"||v==="bazi"||v==="ziwei"||v==="qimen"||v==="daliuren",v!=="tarot"&&(T.datetime=Ti),v==="bazi"||v==="ziwei"||v==="hepan"||v==="trend"){if(T.gender=_e,T.trueSolar=Yt,ht.trim()){T.address=ht.trim();try{const I=await U.geocodeAddress(T.address,{online:ge});I&&typeof I.lon=="number"&&(T.longitude=I.lon,T.geo=I)}catch(I){console.error("[metaphysics] 地址解析失败,退回内置表",I)}if(Xt())return}(v==="bazi"||v==="ziwei")&&(T.cross=Pt),T.lateZi=Vt,ye&&We&&(T.hourUnknown=!0)}if(v==="liuyao"){const I=Ne.parseLines(Ni);I.lines?T.lines=I.lines:I.warning&&Me(I.warning)}if(v==="qimen"&&(T.juMethod=zt,T.lateZiHourMode=Dt,T.direction=Le),v==="bazi"&&(T.verifyPast=6),v==="zeri"){T.startDate=qe.date,T.task=St,T.days=Number(lt)||30,it&&(T.shengXiao=it);const I=Pe.split(/[,,、\s]+/).filter(Boolean);I.length&&(T.candidates=I)}if(v==="xiaoliuren")if(T.mode=i,i==="number")T.num1=Number(l)||void 0,T.num2=Number(c)||void 0,T.num3=Number(m)||void 0;else{T.date=qe.date;const I=Number(String(qe.time).split(":")[0]);T.hour=Number.isFinite(I)?I:12}if(v==="mbti"){delete T.datetime;const I=f.slice();for(;I.length&&I[I.length-1]==null;)I.pop();I.length&&(T.answers=I)}if(v==="trend"&&ye&&We&&(T.hourUnknown=!0),v==="trend"&&(T.toAge=Number(L)||60),v==="fengshui"&&(T.action=M,M==="natal"?T.gender=_e:(T.sitting=z,T.facing=F,delete T.datetime,M==="xuankong"&&(T.period=Number(P)||9))),v==="name"&&(T.action=$,T.surname=k.trim(),$==="generate"?(T.gender=_e,T.limit=Number(ue)||6,T.trueSolar=Yt,T.lateZi=Vt):(T.givenName=ee.trim(),(!qe.date||!qe.time)&&delete T.datetime)),v==="convert")if(T.system="convert",Te==="lunar2solar"){const I=/^(\d{4})-(\d{1,2})-(\d{1,2})$/.exec(String(dt).trim());if(!I){Xe("农历转公历请按「农历年-月-日」填写,例如 2026-9-17;闰月单独勾选。");return}T.mode="lunar2solar",T.lunarYear=Number(I[1]),T.lunarMonth=Number(I[2]),T.lunarDay=Number(I[3]),T.isLeapMonth=Ct,delete T.datetime}else T.mode="solar2lunar";if(v==="tarot"&&(T.count=Number(Sa)),v==="hepan"&&(T.chart=Ge,T.partner={datetime:`${he}T${G}`,gender:R,address:ve.trim()||void 0,trueSolar:Ze},Oe&&(T.partner2={datetime:`${Be}T${et}`,gender:wt,address:Fe.trim()||void 0,trueSolar:Ze})),Ie(v)){if(!ha.trim()){Xe("请先填写「所问之事」——一句话即可,例如:今年是否适合换工作?"),da(!0),A(null);return}da(!1),T.question=ha.trim(),v==="liuyao"&&(T.direction=Le)}if(v==="meihua"&&(T.mode=se,se==="number")){if(ca.trim()===""||ma.trim()===""){Xe("数字起卦需要填两个数(第一个数定上卦、第二个数定下卦)。"),A(null);return}if(T.upper=Number(ca),T.lower=Number(ma),!Number.isFinite(T.upper)||!Number.isFinite(T.lower)){Xe("两个数都要是数字,例如 17 和 29。"),A(null);return}ua!==""&&(T.changing=Number(ua))}const Bn=Lt();v==="trend"&&!T.asOf&&Ne.todayStamp&&(T.asOf=Ne.todayStamp());const At=U.compute(T),Zn=Lt()-Bn;let Ta=null;try{Ta=B.shadowTrack?B.shadowTrack(At):null}catch{Ta=null}let La=null;if(v==="bazi")try{La=U.compute({system:"trend",datetime:Ti,gender:_e,toAge:100,trueSolar:Yt,lateZi:Vt,...Ne.todayStamp?{asOf:T.asOf||Ne.todayStamp()}:{},...T.dst!==void 0?{dst:T.dst}:{},...T.address?{address:T.address}:{},...typeof T.longitude=="number"?{longitude:T.longitude}:{},...T.geo?{geo:T.geo}:{}})}catch{La=null}let Ea=null;if(U.caliberCompare)try{Ea=U.caliberCompare(T)}catch{Ea=null}const Un=Ie(v)||v==="qimen"?{question:Ie(v)?ha.trim():"",direction:Le}:void 0,xa=U.interpret?U.interpret(At,Un):null;xa&&At.cross&&U.crossSection&&(xa.sections=[...xa.sections||[],U.crossSection(At.cross)]);const Kn=yt(v)==="cast"&&(v!=="meihua"||se==="time");A({kind:v,r:At,it:xa,at:qe,timed:Kn,trend:La,caliber:Ea,shadowDiff:Ta,gender:_e,address:ht,trueSolar:Yt,lateZi:Vt});const Li=I=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>I>1?Li(I-1):Ei()):setTimeout(Ei,0)},Ei=()=>{Ci===Re&&y({engineMs:xt,computeMs:Zn,cached:Ai,totalMs:Lt()-Mi,renderMs:null})};if(Li(2),Bt(null),at(null),rt({}),Zt(null),Xe(""),ft(""),v!=="tarot"&&v!=="mbti"){const I=!!(ye&&We),_i={kind:v,date:qe.date,time:I?"":qe.time,hourUnknown:I,gender:_e,address:ht,trueSolar:Yt,lateZi:Vt,lines:v==="liuyao"?Ni:"",question:Ie(v)?ha.trim():"",direction:Le,count:Sa,mhMode:se,upper:ca,lower:ma,changing:ua,...v==="qimen"?{qimenRule:zt,qLateZi:Dt}:{},...v==="zeri"?{task:St,days:lt,shengXiao:it,zCand:Pe}:{},...v==="xiaoliuren"?{xlrMode:i,num1:l,num2:c,num3:m}:{},...v==="trend"?{toAge:L}:{},...v==="fengshui"?{fsMode:M,fsPeriod:P,sitting:z,facing:F}:{},...v==="name"?{nnMode:$,surname:k,givenName:ee,limitN:ue}:{},...v==="convert"?{convMode:Te,lunarDate:dt,leapMonth:Ct}:{},...v==="hepan"?{hpChart:Ge,partnerDate:he,partnerTime:G,partnerGender:R,partnerAddress:ve,thirdOn:Oe,p2Date:Be,p2Time:et,p2Gender:wt,p2Address:Fe}:{},label:Ri(v,At),at:Date.now()};ne(Yn=>{const Hi=[_i,...Yn.filter(Vn=>!Pi(Vn,_i))].slice(0,20);return Pa(Hi),Hi})}}catch(xt){if(Xt())return;Xe(xt&&xt.message?xt.message:String(xt)),A(null)}},dn=async t=>{const g=yt(t),N=++Re;if(Xe(""),t==="mbti"){Me(""),la(!0);try{await va(t)}catch(v){N===Re&&Xe(v&&v.message?v.message:String(v))}finally{N===Re&&la(!1)}if(N!==Re)return;n(t),f.filter(v=>v!=null).length>=Je?je(t):A(null);return}if(n(t),g==="none"){je(t);return}const _=Ca[g]||(g==="cast"||g==="date"?wa():{date:Ya.date,time:Ya.time});D(_.date),te(_.time),je(t,_)},cn=t=>{He.some(g=>g.k===t)&&ct(g=>{const N=(g||[]).filter(v=>v&&v.tab&&v.tab!==t),_=[{tab:t,at:Date.now()}].concat(N).slice(0,Za);return Ka(Ga,_),_})},xi=t=>{const g=t==="flat"?"flat":"group";we(g),Ka(Ba,g)},Aa=t=>{cn(t),dn(t)},mn=t=>{D(t),Ee!=="none"&&ga(g=>Object.assign({},g,{[Ee]:{date:t,time:V}}))},un=t=>{te(t),Ee!=="none"&&ga(g=>Object.assign({},g,{[Ee]:{date:q,time:t}}))},Wn=()=>{const t=wa();D(t.date),te(t.time),Ee!=="none"&&ga(g=>Object.assign({},g,{[Ee]:null})),je(s,t)},bi=()=>{if(s==="mbti"){const t=f.filter(g=>g!=null).length;if(t<Je){Me(`先答满 ${Je} 题再看结果(现答 ${t} 题,还差 ${Je-t} 题)。`);return}je(s);return}if(Ee!=="none"&&!Ca[Ee]){const t=wa();D(t.date),te(t.time),je(s,t);return}je(s)},gn=()=>{const t={date:"1990-05-12",time:"14:30"};n("bazi"),fe("male"),O("河北石家庄"),ga(g=>Object.assign({},g,{birth:t})),D(t.date),te(t.time),je("bazi",t,null,{gender:"male",address:"河北石家庄"})},vi=t=>{di(t),je(s,{date:q,time:V},t)},fn=()=>!!(window.matchMedia&&window.matchMedia("(max-width: 640px)").matches),hn=()=>li===null?fn():li,fa=(t,g,N)=>{if(!g)return;const _=se=>{t.textContent=se?"已复制":"复制失败",setTimeout(()=>{t.textContent=N},1400)},v=()=>{try{const se=document.createElement("textarea");se.value=g,se.setAttribute("readonly",""),se.style.position="fixed",se.style.opacity="0",document.body.appendChild(se),se.select();const ye=!!(document.execCommand&&document.execCommand("copy"));return document.body.removeChild(se),ye}catch{return!1}};try{if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(g).then(()=>_(!0),()=>_(v()));return}}catch{}_(v())},xn=t=>fa(t,t.getAttribute("data-shadow-copy")||"","复制 ID"),bn=t=>fa(t,t.getAttribute("data-handle-copy")||"","复制句柄"),vn=t=>{const g=t.closest(".mp-trace-layer")||document.getElementById("mp-trace-layer"),N=g&&g.querySelector("[data-trace-md]");fa(t,N?N.value:"","复制 Markdown")},yn=()=>{try{return String(location.href).split("#")[0]}catch{return""}},$n=()=>{if(!b||!b.r)return null;try{return U.askPackages?U.askPackages(b.r,{question:Ma(),interpret:b.it,base:yn()}):null}catch{return null}},yi=[["full","复制提问","完整提问:盘面摘要 + 阅读层次 + 回答骨架,粘进任何对话窗都能用"],["brief","复制精简","一句话版:体系 + 排盘句柄 + 你的问题,够助手认出是哪张盘"],["structured","复制参数","结构化参数(JSON):助手可直接照 args 调 compute,不必解析自然语言"],["link","复制深链","深链:把这张盘的参数编进链接,打开即还原同一张盘(换台机器、发给朋友都行)"]],wn=(t,g)=>{const N=$n();if(!N){Ae("还没有可以复制的盘:先排一张。");return}const _=t==="link"?N.link:N[t];if(!_){Ae(t==="link"?"这张盘没拿到句柄(随机抽牌只复现参数、不复现牌面),深链做不出来;用「复制提问」那一档。":"这一档暂时是空的,换一档试试。");return}fa(g,_,yi.find(v=>v[0]===t)[1]),t==="link"&&Ae("深链已复制:打开就还原这张盘,也可以直接发给别人。链接里是编码不是加密,别公开贴。")},kn=()=>{const t=document.getElementById("mp-trace-layer");if(!t)return;t.classList.add("open"),t.setAttribute("aria-hidden","false");const g=t.querySelector("[data-trace-close]");g&&g.focus&&g.focus()},$i=()=>{const t=document.getElementById("mp-trace-layer");if(!t)return;t.classList.remove("open"),t.setAttribute("aria-hidden","true");const g=document.querySelector("[data-trace-open]");g&&g.focus&&g.focus()},zn=t=>{const g=t.target&&t.target.closest?t.target.closest("[data-shadow-copy]"):null;if(g){xn(g);return}const N=t.target&&t.target.closest?t.target.closest("[data-handle-copy]"):null;if(N){bn(N);return}if(t.target&&t.target.closest?t.target.closest("[data-trace-open]"):null){kn();return}const v=t.target&&t.target.closest?t.target.closest("[data-trace-copy]"):null;if(v){vn(v);return}if(t.target&&t.target.closest?t.target.closest("[data-mp-askcopy]"):null){Sn();return}if(t.target&&t.target.closest?t.target.closest("[data-trace-close]"):null){$i();return}const We=t.target&&t.target.closest?t.target.closest(".mp-it-head"):null;if(!We)return;const qe=We.closest(".mp-it");if(!qe)return;const _e=!qe.classList.contains("folded");qe.classList.toggle("folded",_e),We.setAttribute("aria-expanded",_e?"false":"true");const ht=We.querySelector(".mp-it-hint");ht&&(ht.textContent=_e?"点击展开":"点击收起"),on(_e)},wi=(t,g)=>{if(!b||!(Ie(s)||s==="qimen"))return;const N={question:Ie(s)?(g===void 0?nt:g).trim():"",direction:t===void 0?Le:t},_=U.interpret?U.interpret(b.r,N):null;let v=b.r;if((s==="liuyao"||s==="qimen")&&v&&v.trace&&U.buildTrace)try{const se=s==="liuyao"?U.buildTrace(v,{direction:N.direction,gender:v.useGod&&v.useGod.gender||"male",refresh:!0}):U.buildTrace(v,{direction:N.direction});se&&(v=Object.assign({},v,{trace:se}))}catch{}A(Object.assign({},b,{r:v,it:_}))},jn=t=>!t||!t.timed||!t.at?"":`<div class="mp-cast">起卦时刻:<b>${t.at.date} ${t.at.time}</b> (来自你的本机时间,点「此刻」可重新取当下)</div>`,qn=()=>{try{const t=b&&b.r&&b.r.summary?b.r.summary:"";if(!t)return;navigator.clipboard.writeText(t).then(()=>ft("已复制"),()=>ft("复制失败"))}catch{ft("复制失败")}},Sn=()=>{if(!b||!b.r||!window.Engine||!window.Engine.buildEventPrompt)return;const t=Ne&&Ne.kindOfDirection?Ne.kindOfDirection(Le):"other";let g;try{g=window.Engine.buildEventPrompt(b.r,{question:(nt||"").trim(),kind:t,gender:a,timeKnown:!0})}catch{g=null}g&&g.text&&navigator.clipboard.writeText(g.text).then(()=>ft("已复制问事提示"),()=>ft("复制失败"))},ki=()=>{if(!(!b||!b.r||!Ce.trim()))try{Bt(U.followup?U.followup(b.r,Ce.trim()):null)}catch(t){Bt({question:Ce.trim(),ok:!1,answer:"追问失败:"+(t&&t.message?t.message:t),evidence:[],confidence:"弱"})}},Nn=()=>{if(!(!b||!b.r))try{const t=U.askPrompt?U.askPrompt(b.r,{question:Ma(),interpret:b.it}):null,g=t&&t.text?t.text:String(b.r.summary||"");if(ei(g)){Ae("已发到对话窗,往下看回复。");return}const N="("+Va()+")";navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(g).then(()=>Ae("对话输入框还没就绪"+N+",已复制提问;粘进对话窗回车即可。"),()=>Ae("对话输入框还没就绪"+N+",复制也没成功;先点「复制文字结果」再贴。")):Ae("对话输入框还没就绪"+N+";先点「复制文字结果」再贴进对话窗。")}catch(t){Ae("发到对话窗失败:"+(t&&t.message?t.message:t))}},Mn=()=>{const t=[],g=window.__MP_VER||"未知";t.push("# 命理插件反馈"),t.push(""),t.push("## 我遇到的情况"),t.push(""),t.push("(在这里写一句就好:哪里不对 / 读不懂哪一段 / 算得和别人不一样 / 想加什么。下面这些是自动带的复现信息,不用改。)"),t.push(""),t.push("## 复现信息"),t.push(""),t.push("- 插件版本:v"+g);{const v=Array.isArray(window.__MP_UNRELEASED)?window.__MP_UNRELEASED:[];v.length&&t.push("- 未发版改动:"+v.length+" 项(版本号未变,说明这份产物比 v"+g+" 新)")}const N=He.find(v=>v.k===s)?.label||s;if(t.push("- 体系:"+N+(N===s?"":"("+s+")")),nt&&t.push("- 所问之事:"+nt),Le&&Le!=="general"){const v=(Array.isArray(U.DIRECTIONS)?U.DIRECTIONS:[]).find(se=>se.key===Le);t.push("- 询问方向:"+(v?v.label:Le))}t.push(""),t.push("### 输入"),t.push(""),t.push("```"),(yt(s)==="time"||yt(s)==="date")&&(t.push(`日期:${q}`),yt(s)==="time"&&t.push(`时刻:${ie?"(未知,按三柱排)":V}`),t.push(`性别:${a==="male"?"男":"女"}`),ze&&t.push(`出生地:${ze}`),t.push(`真太阳时:${Ze?"开":"关"} 晚子时换日:${tt?"开":"关"}`),s==="qimen"&&t.push(`奇门取局:${zt}`),Pt&&t.push("交叉验证:开"));const _={合盘:()=>{t.push(`对方:${he} ${G} ${R==="male"?"男":"女"}${ve?" "+ve:""}(${Ge} 盘)`),Oe&&t.push(`第三方:${Be} ${et} ${wt==="male"?"男":"女"}${Fe?" "+Fe:""}`)},择日:()=>{t.push(`事项:${St} 起算:${q} 天数:${lt}${it?" 属相:"+it:""}${Pe?" 候选日:"+Pe:""}`)},起名:()=>{t.push(`姓:${k||"(未填)"} 名:${ee||"(未填)"} 模式:${$}${$==="generate"?" 候选数:"+(ue||"默认"):""}`)},公农历:()=>{t.push(`模式:${Te}${dt?" 农历输入:"+dt:""}${Ct?"(闰月)":""}`)},小六壬:()=>{t.push(`模式:${i}${i==="number"?` 报数:${l}/${c}/${m}`:""}`)},风水:()=>{t.push(`动作:${M}${M==="natal"?"":` 坐:${z} 向:${F}`}${M==="xuankong"?` 运:${P}`:""}`)}};if(_[N]&&_[N](),t.push("```"),t.push(""),ut&&(t.push("### 报错原文"),t.push(""),t.push("```"),t.push(String(ut)),t.push("```"),t.push("")),b&&b.r){t.push("### 结果摘要(引擎原文,前 40 行)"),t.push(""),t.push("```");const v=String(b.r.summary||(U.renderText?U.renderText(b.r):"")||"");t.push(v.split(`
|
|
2224
2236
|
`).slice(0,40).join(`
|
|
2225
|
-
`)),t.push("```"),
|
|
2226
|
-
`)},wi=()=>{const t=Mn();try{if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t).then(()=>{re("已复制"),v("粘到 issue / 邮件 / 群里即可")}).catch(()=>{re("复制失败"),v("可改用「导出 .md」或手动选中")});else{const g=document.createElement("textarea");g.value=t,g.style.cssText="position:fixed;left:-9999px;top:0",document.body.appendChild(g),g.select();const N=document.execCommand&&document.execCommand("copy");g.remove(),re(N?"已复制":"复制失败"),v(N?"粘到 issue / 邮件 / 群里即可":"可改用「导出 .md」或手动选中")}}catch{re("复制失败"),v("可改用「导出 .md」")}setTimeout(()=>{re(""),v("")},4e3)},An=()=>{try{wi()}catch{}const t=encodeURIComponent("[反馈] "+(He.find(g=>g.k===n)?.label||n)+(gt?":报错":":使用问题"));try{window.open("https://github.com/xuanfu-web/dsh-metaphysics/issues/new?title="+t,"_blank","noopener")}catch{v("浏览器拦了弹窗,请手动打开 GitHub issues")}},Cn=()=>{if(!(!f||!f.r))try{const t=K.renderText?K.renderText(f.r):f.r.summary||"",g=new Blob([t],{type:"text/markdown;charset=utf-8"}),N=document.createElement("a");N.href=URL.createObjectURL(g),N.download=`命理报告-${f.r.system}.md`,document.body.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(N.href),2e3)}catch(t){console.error("[metaphysics] 导出失败",t)}},Tn=()=>{if(!(!f||!f.r))try{const t=B.summaryCardPNG?B.summaryCardPNG(f.r,f.it):"";if(!t){ht("当前环境不支持 Canvas 导出");return}const g=document.createElement("a");g.href=t,g.download=`命理摘要-${f.r.system}.png`,document.body.appendChild(g),g.click(),g.remove()}catch(t){console.error("[metaphysics] 长图导出失败",t)}},ki={fontSize:12,padding:"5px 12px"},Ln=()=>{!f||!f.r||!f.r.past||ta(K.verifyFit?K.verifyFit(f.r.past.rows,It):null)},En=()=>{if(!(!f||f.kind!=="bazi"))try{const t=f.at||{date:q,time:V},[g,N,E]=String(t.date).split("-").map(Number),[,y]=String(t.time).split(":").map(Number),ne=pt.filter(ye=>Number(ye.year)).map(ye=>({year:Number(ye.year),kind:ye.kind}));Gt(K.rectifyBirth?K.rectifyBirth({base:{year:g,month:N,day:E,minute:Number.isFinite(y)?y:0},gender:f.gender||a,events:ne,lateZi:typeof f.lateZi=="boolean"?f.lateZi:ot,trueSolar:typeof f.trueSolar=="boolean"?f.trueSolar:Oe,address:String(f.address||"").trim()||void 0}):{error:"当前客户端未加载生时校正模块"})}catch(t){Gt({error:t&&t.message?t.message:String(t)})}},J=(t,g)=>p("label",{className:"mp-field"},p("span",{className:"mp-lbl"},t),g),_n=t=>{s(t.kind),t.date&&P(t.date),t.time&&ee(t.time),se(!!t.hourUnknown),t.gender&&ge(t.gender),F(t.address||""),typeof t.trueSolar=="boolean"&&St(t.trueSolar),typeof t.lateZi=="boolean"&&Nt(t.lateZi),L(t.lines||""),qa(t.question||""),oi(t.direction||"general"),si(t.count||"3"),pi(t.mhMode||"time"),li(t.upper||""),di(t.lower||""),ci(t.changing||""),t.kind==="qimen"&&(typeof t.qimenRule=="string"&&Ft(t.qimenRule),typeof t.qLateZi=="string"&&Mt(t.qLateZi)),t.kind==="zeri"&&(typeof t.task=="string"&&ia(t.task),t.days!=null&&Ne(String(t.days)),typeof t.shengXiao=="string"&&Ct(t.shengXiao),typeof t.zCand=="string"&&Bt(t.zCand)),t.kind==="xiaoliuren"&&(o(t.xlrMode==="number"?"number":"time"),t.num1!=null&&d(String(t.num1)),t.num2!=null&&u(String(t.num2)),t.num3!=null&&b(String(t.num3))),t.kind==="trend"&&t.toAge!=null&&X(String(t.toAge)),t.kind==="fengshui"&&(typeof t.fsMode=="string"&&w(t.fsMode),t.fsPeriod!=null&&te(String(t.fsPeriod)),typeof t.sitting=="string"&&oe(t.sitting),typeof t.facing=="string"&&ce(t.facing)),t.kind==="name"&&(typeof t.nnMode=="string"&&O(t.nnMode),typeof t.surname=="string"&&$e(t.surname),typeof t.givenName=="string"&&pe(t.givenName),t.limitN!=null&&Fe(String(t.limitN))),t.kind==="convert"&&(typeof t.convMode=="string"&&Zt(t.convMode),typeof t.lunarDate=="string"&&e(t.lunarDate),typeof t.leapMonth=="boolean"&&r(t.leapMonth)),t.kind==="hepan"&&(t.hpChart&&kt(t.hpChart),typeof t.partnerDate=="string"&&he(t.partnerDate),typeof t.partnerTime=="string"&&Z(t.partnerTime),typeof t.partnerGender=="string"&&Y(t.partnerGender),typeof t.partnerAddress=="string"&&wt(t.partnerAddress),typeof t.thirdOn=="boolean"&&_t(t.thirdOn),typeof t.p2Date=="string"&&$a(t.p2Date),typeof t.p2Time=="string"&&jt(t.p2Time),typeof t.p2Gender=="string"&&Ht(t.p2Gender),typeof t.p2Address=="string"&&Ot(t.p2Address)),ra(!1),ei(t)},Hn=()=>{we([]),Fa([])},On=["bazi","ziwei","trend","chenggu"],zi=t=>{s(t.kind),P(t.date),t.time&&ee(t.time),se(!!t.hourUnknown),t.gender&&ge(t.gender),F(t.address||""),St(t.trueSolar!==!1),Nt(t.lateZi!==!1)},Fn=t=>{const g=B.profEvent(t.target);if(!g)return;const N=y=>ti.find(ne=>ne.id===y),E=t.currentTarget.querySelector(".mp-prof-name");if(ii(""),g.action==="use"){const y=N(g.id);if(!y)return;if(!B.profUsable(y)){Ae("这张档案没有出生时刻,先补上时刻再存一次。");return}Ve="",na(B.profilesTouch(y.id)),zi(y),je(y.kind,{date:y.date,time:y.hourUnknown?"12:00":y.time},void 0,{gender:y.gender||void 0,address:y.address||"",hourUnknown:!!y.hourUnknown,trueSolar:y.trueSolar!==!1,lateZi:y.lateZi!==!1});return}if(g.action==="edit"){const y=N(g.id);if(!y)return;zi(y),Ve=y.label,sa(y.id);return}if(g.action==="cancel"){Ve="",sa(null);return}if(g.action==="pin"){na(B.profilesPin(g.id));return}if(g.action==="del"){if(ai!==g.id){ii(g.id);return}na(B.profilesRemove(g.id)),Ut===g.id&&(Ve="",sa(null)),Ae("已从本机删除这张档案卡(不影响已经排出来的盘)。");return}if(g.action==="put"){const y=Ut,ne=B.profFromForm({kind:n,date:q,time:V,hourUnknown:ae,gender:a,address:ze,trueSolar:Oe,lateZi:ot},E?E.value:Ve,Ut||void 0);if(!ne){Ae("先填好出生日期(和时刻),再存档案。");return}const ye=B.profilesPut(ne);if(!ye.ok){Ae("档案没能存进本机(存储被禁用或已满),排盘不受影响。");return}na(ye.list),Ve="",sa(null),E&&(E.value=""),Ae(`${y?"已更新档案":"已存入我的命盘"}「${ye.item.label}」。`)}},Dn=t=>{const g=t.target&&t.target.closest?t.target.closest(".mp-prof-name"):null;g&&(Ve=g.value)},Pn=t=>{const g=K.formOf?K.formOf(t):null;if(!g){je("ziwei");return}const N=He.some(ye=>ye.k===g.tab)?g.tab:"ziwei",E={date:g.date||q,time:g.time||V},y=g.lines===void 0?void 0:Array.isArray(g.lines)?g.lines.join(" "):String(g.lines);g.date&&P(g.date),g.time&&ee(g.time),g.gender&&ge(g.gender),typeof g.address=="string"&&F(g.address),typeof g.trueSolar=="boolean"&&St(g.trueSolar),typeof g.lateZi=="boolean"&&Nt(g.lateZi),y!==void 0&&L(y),g.question&&qa(g.question),s(N);const ne=K.restNote?K.restNote(g):"";Ce(`已按深链还原:${t.label}${g.question?`|${g.question}`:""}${ne?` ${ne}`:""}`),je(N,E,void 0,{gender:g.gender,address:g.address,trueSolar:g.trueSolar,lateZi:g.lateZi,lines:y,question:g.question})};vt(()=>{let t=!1;const g=De;return(async()=>{let N=null;try{await ha(n);const E=typeof location<"u"?String(location.href):"";E&&E.indexOf("mp=")>=0&&window.Engine&&window.Engine.parseAskLink&&(N=window.Engine.parseAskLink(E))}catch{N=null}if(!(t||De!==g)){if(N&&N.ok)try{Pn(N);return}catch{}je("ziwei")}})(),()=>{t=!0}},[]),vt(()=>{if(!za)return;const t=za.kind;ei(null),je(t)},[za]),vt(()=>{const t=g=>{if(g.key!=="Escape")return;const N=document.getElementById("mp-trace-layer");N&&N.classList.contains("open")&&vi()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[]);const ji=(ut||[]).filter(t=>t&&He.some(g=>g.k===t.tab)).slice(0,Ga),Rn=t=>(He.find(g=>g.k===t)||{}).label||t,In=({k:t,label:g,tip:N,wide:E})=>p("button",{key:t,type:"button",className:"mp-tool"+(E?" wide":"")+(n===t?" on":""),"data-tab":t,onClick:()=>Ma(t)},p("b",null,g),p("span",null,N)),Gn=[p("div",{key:"profiles",className:"mp-profwrap",onClick:Fn,onInput:Dn,dangerouslySetInnerHTML:{__html:B.profilesHTML(ti,{editingId:Ut,armedDel:ai,bar:On.indexOf(n)>=0?B.profilesBarHTML({editingId:Ut,name:Ve}):""})}}),p("section",{key:"start",className:"mp-start","aria-label":"选择要算的事"},p("div",{className:"mp-start-top"},p("div",{className:"mp-recent",hidden:ji.length===0},p("span",{className:"mp-recent-lbl"},"最近用过"),p("span",{className:"mp-recent-list"},ji.map(t=>p("button",{key:t.tab,type:"button",className:"mp-rc",onClick:()=>Ma(t.tab)},Rn(t.tab),p("i",null,Yi(t.at)))))),p("div",{className:"mp-viewsw",role:"group","aria-label":"首屏视图"},p("button",{type:"button",className:xe==="group"?"on":"","aria-pressed":xe==="group"?"true":"false",onClick:()=>fi("group")},"分组"),p("button",{type:"button",className:xe==="flat"?"on":"","aria-pressed":xe==="flat"?"true":"false",onClick:()=>fi("flat")},"平铺"))),xe==="group"?p("div",{className:"mp-groups"},Ki.map(t=>{const g=!!an[t.title],N=Math.max(0,t.items.length-4);return p("section",{key:t.title,className:"mp-tgroup"+(g?" open":"")},p("div",{className:"mp-tgroup-head"},p("h2",null,t.title),p("p",null,t.hint)),p("div",{className:"mp-ttools"},t.items.map(In),N>0?p("button",{key:"more",type:"button",className:"mp-tmore","aria-expanded":g?"true":"false",onClick:()=>nn(E=>Object.assign({},E,{[t.title]:!g}))},g?"收起":`还有 ${N} 个`):null))})):null),p("div",{key:"tabs",className:"mp-tabs"+(xe==="flat"?"":" hide"),role:"tablist","aria-label":"命理体系"},He.map(t=>p("button",{key:t.k,role:"tab","aria-selected":n===t.k?"true":"false",tabIndex:n===t.k?0:-1,className:"mp-tab"+(n===t.k?" on":""),onClick:()=>Ma(t.k)},t.label))),p("div",{key:"head",className:"mp-panel"},p("div",{className:"mp-row"},ui?J(Kt?"出生日期(公历)":Ee==="date"?"日期(公历)":"起卦日期(公历)",p(xa,{value:q,onChange:mn,onInvalid:()=>Ae("日期请按「年-月-日」填写,例如 1990-05-12。")})):null,gi?J(Kt?"出生时刻":"起卦时刻",p("input",{className:"mp-input",type:"time",value:V,disabled:ae&&(n==="bazi"||n==="trend"),onChange:t=>un(t.target.value)})):null,n==="bazi"||n==="trend"?p("label",{className:"mp-chk",title:"不知道出生时辰时勾这里:不排时柱,起运按日估算,结果首行会写明"},p("input",{type:"checkbox",checked:ae,onChange:t=>se(t.target.checked)})," 时辰未知"):null,Kt?J("性别",p("select",{className:"mp-input",value:a,onChange:t=>ge(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,Kt?J("出生地(省/市即可)",p("input",{className:"mp-input",placeholder:"如 河北石家庄 / 成都",value:ze,onChange:t=>F(t.target.value)})):null,n==="bazi"||n==="ziwei"?p("label",{className:"mp-field mp-checks"},p("input",{type:"checkbox",checked:We,onChange:t=>Pt(t.target.checked)}),p("span",{className:"mp-lbl"},"八字 × 紫微 交叉验证")):null,n==="hepan"?J("对方出生日期",p(xa,{value:fe,onChange:he,onInvalid:()=>Ae("对方出生日期请按「年-月-日」填写,例如 1992-08-15。")})):null,n==="hepan"?J("对方出生时刻",p("input",{className:"mp-input",type:"time",value:G,onChange:t=>Z(t.target.value)})):null,n==="hepan"?J("对方性别",p("select",{className:"mp-input",value:R,onChange:t=>Y(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,n==="hepan"?J("合盘方式",p("div",{className:"mp-seg"},p("button",{className:nt==="bazi"?"on":"",onClick:()=>kt("bazi")},"八字"),p("button",{className:nt==="ziwei"?"on":"",onClick:()=>kt("ziwei")},"紫微"))):null,n==="hepan"?J("对方出生地(可空)",p("input",{className:"mp-input",placeholder:"如 四川成都",value:ve,onChange:t=>wt(t.target.value)})):null,n==="hepan"?p("label",{className:"mp-field mp-checks"},p("input",{type:"checkbox",checked:Se,onChange:t=>_t(t.target.checked)}),p("span",{className:"mp-lbl"},"三方合盘(加入第三人)")):null,n==="hepan"&&Se?J("第三方出生日期",p(xa,{value:Xe,onChange:$a,onInvalid:()=>Ae("第三方出生日期请按「年-月-日」填写,例如 1990-01-01。")})):null,n==="hepan"&&Se?J("第三方出生时刻",p("input",{className:"mp-input",type:"time",value:zt,onChange:t=>jt(t.target.value)})):null,n==="hepan"&&Se?J("第三方性别",p("select",{className:"mp-input",value:Re,onChange:t=>Ht(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,n==="hepan"&&Se?J("第三方出生地(可空)",p("input",{className:"mp-input",placeholder:"如 广东广州",value:st,onChange:t=>Ot(t.target.value)})):null,n==="qimen"?p("fieldset",{key:"qmr",className:"mp-qmrule"},p("legend",{className:"mp-lbl"},"换局规则"),p("div",{className:"mp-qmopts",role:"radiogroup","aria-label":"奇门换局规则"},[["chaibu","拆补"],["chaoshen","超神接气"],["zhirun","置闰"]].map(([t,g])=>p("label",{key:t,className:"mp-qmopt"},p("input",{type:"radio",name:"qimen_rule",value:t,checked:qt===t,onChange:()=>Ft(t)}),p("span",null,g)))),p("div",{className:"mp-field"},p("span",{className:"mp-lbl"},"晚子时"),p("select",{className:"mp-input",value:Dt,onChange:t=>Mt(t.target.value)},p("option",{value:"same-day"},"23:00 后归当日"),p("option",{value:"next-day"},"23:00 后归次日"))),p("details",{className:"mp-qmhelp"},p("summary",null,"三种规则有什么区别?"),p("p",null,"决定符头与节气如何对齐、是否插入闰局;同一个时刻在不同规则下可能得到不同局数。默认「拆补」与工具层一致。"))):null,Pe(n)||n==="qimen"?J(n==="qimen"?"询问方向(定用神)":"询问方向",p("select",{className:"mp-input",value:Le,onChange:t=>{oi(t.target.value),yi(t.target.value)}},(K.DIRECTIONS||[]).map(t=>p("option",{key:t.key,value:t.key},t.label)))):null,n==="tarot"?J("张数",p("select",{className:"mp-input",value:ja,onChange:t=>si(t.target.value)},p("option",{value:"1"},"1 张 · 指引"),p("option",{value:"3"},"3 张 · 过去现在未来"),p("option",{value:"5"},"5 张 · 十字牌阵"))):null,n==="liuyao"?J("六爻(可空)",p("input",{className:"mp-input",placeholder:"空则随机,如 9 7 8 8 7 6",value:be,onChange:t=>L(t.target.value)})):null,n==="meihua"?J("起卦方式",p("div",{className:"mp-seg"},p("button",{className:ft==="time"?"on":"",onClick:()=>xi("time")},"时间"),p("button",{className:ft==="number"?"on":"",onClick:()=>xi("number")},"数字"))):null,n==="meihua"&&ft==="number"?J("第一个数",p("input",{className:"mp-input",value:pa,placeholder:"如 17",onChange:t=>li(t.target.value)})):null,n==="meihua"&&ft==="number"?J("第二个数",p("input",{className:"mp-input",value:la,placeholder:"如 29",onChange:t=>di(t.target.value)})):null,n==="meihua"&&ft==="number"?J("动爻(可空)",p("input",{className:"mp-input",value:da,placeholder:"1-6",onChange:t=>ci(t.target.value)})):null,n==="zeri"?J("所办事项",p("select",{className:"mp-input",value:lt,onChange:t=>ia(t.target.value)},[["常用",["嫁娶","搬家入宅","出行","开业","签订合同","祭祀"]],["婚嫁",["嫁娶","订婚","领证","提亲","收送聘金","满月酒"]],["生活",["搬家","入宅","旅行","访亲友","入学","求医","祭祀"]],["建造",["动土","装修","装修建造","安葬","试车买车"]],["工商",["开业","交易","投资","签订合同","签约","纳财","赴任"]]].map(([t,g])=>p("optgroup",{key:t,label:t},g.map(N=>p("option",{key:`${t}-${N}`,value:N},N)))))):null,n==="convert"?J("转换方向",p("div",{className:"mp-seg"},p("button",{className:Be==="solar2lunar"?"on":"",onClick:()=>Zt("solar2lunar")},"公历 → 农历"),p("button",{className:Be==="lunar2solar"?"on":"",onClick:()=>Zt("lunar2solar")},"农历 → 公历"))):null,n==="convert"&&Be==="lunar2solar"?J("农历日期",p("input",{className:"mp-input",value:dt,placeholder:"如 2026-9-17",onChange:t=>e(t.target.value)})):null,n==="convert"&&Be==="lunar2solar"?p("label",{className:"mp-check"},p("input",{type:"checkbox",checked:i,onChange:t=>r(t.target.checked)})," 闰月"):null,n==="zeri"?J("看多少天",p("input",{className:"mp-input",type:"number",min:1,max:60,value:At,onChange:t=>Ne(t.target.value)})):null,n==="zeri"?J("候选日(可空,只比这几天)",p("input",{className:"mp-input",placeholder:"如 2026-12-01, 2026-12-08, 2026-12-15",value:Ge,onChange:t=>Bt(t.target.value)})):null,n==="zeri"?J("当事人属相(可空)",p("select",{className:"mp-input",value:Te,onChange:t=>Ct(t.target.value)},p("option",{value:""},"不排除"),["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"].map(t=>p("option",{key:t,value:t},t)))):null,n==="xiaoliuren"?J("起课方式",p("div",{className:"mp-seg"},p("button",{className:l==="time"?"on":"",onClick:()=>o("time")},"时间"),p("button",{className:l==="number"?"on":"",onClick:()=>o("number")},"报数"))):null,n==="xiaoliuren"&&l==="number"?J("第一个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:c,onChange:t=>d(t.target.value)})):null,n==="xiaoliuren"&&l==="number"?J("第二个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:m,onChange:t=>u(t.target.value)})):null,n==="xiaoliuren"&&l==="number"?J("第三个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:h,onChange:t=>b(t.target.value)})):null,n==="mbti"?p("div",{className:"mp-quiz-wrap"},p("div",{className:"mp-lbl"},"十六型人格问卷 · 4 题一页,按 1(完全不像)到 5(很像我)打分"),p(Bi,{answers:C,page:T,onPick:(t,g)=>S(N=>{const E=N.slice();return E[t]=g,E}),onPage:t=>j(g=>Math.max(0,Math.min(g+t,Math.max(0,Math.ceil(ea().total/Jt)-1)))),onSubmit:hi,onClear:()=>{S(new Array(ea().total).fill(null)),j(0),U(null)}})):null,n==="trend"?J("算到几岁",p("input",{className:"mp-input",type:"number",min:10,max:100,value:_,onChange:t=>X(t.target.value)})):null,n==="fengshui"?J("看什么",p("div",{className:"mp-seg"},p("button",{className:H==="natal"?"on":"",onClick:()=>w("natal")},"命卦"),p("button",{className:H==="advise"?"on":"",onClick:()=>w("advise")},"门主灶"),p("button",{className:H==="xuankong"?"on":"",onClick:()=>w("xuankong")},"玄空"))):null,n==="fengshui"&&H!=="natal"?J("坐山(24 山)",p("input",{className:"mp-input",value:D,placeholder:"如 子 / 乾",onChange:t=>oe(t.target.value)})):null,n==="fengshui"&&H!=="natal"?J("朝向(24 山)",p("input",{className:"mp-input",value:$,placeholder:"如 午 / 巽",onChange:t=>ce(t.target.value)})):null,n==="fengshui"&&H==="xuankong"?J("运(1–9)",p("input",{className:"mp-input",type:"number",min:1,max:9,value:z,onChange:t=>te(t.target.value)})):null,n==="name"?J("看什么",p("div",{className:"mp-seg"},p("button",{className:k==="assess"?"on":"",onClick:()=>O("assess")},"评名字"),p("button",{className:k==="generate"?"on":"",onClick:()=>O("generate")},"生成候选"))):null,n==="name"?J("姓",p("input",{className:"mp-input",value:Q,placeholder:"如 李",onChange:t=>$e(t.target.value)})):null,n==="name"&&k==="assess"?J("名字",p("input",{className:"mp-input",value:ue,placeholder:"如 沐宸",onChange:t=>pe(t.target.value)})):null,n==="name"&&k==="generate"?J("候选个数",p("input",{className:"mp-input",type:"number",min:1,max:20,value:me,onChange:t=>Fe(t.target.value)})):null),Kt?p("div",{className:"mp-checks"},p("label",{title:"按出生地经度把钟表时间换算成真太阳时"},p("input",{type:"checkbox",checked:Oe,onChange:t=>St(t.target.checked)}),"真太阳时"),p("label",{title:"23:00–23:59 出生时:勾选=按次日日柱起时柱;不勾=仍用当日日柱"},p("input",{type:"checkbox",checked:ot,onChange:t=>Nt(t.target.checked)}),"晚子时换日"),p("label",{title:"开启后会请求 OpenStreetMap,把区县/村落到更精确的坐标"},p("input",{type:"checkbox",checked:Ze,onChange:t=>ct(t.target.checked)}),"联网精确到区县")):null,Pe(n)?p("div",{className:"mp-askblock"},p("span",{className:"mp-lbl"},"所问之事(必填)"),p("textarea",{className:"mp-textarea"+(rn?" invalid":""),rows:2,value:at,placeholder:"用一句话描述所问之事,例如:今年是否适合换工作?",onChange:t=>{qa(t.target.value),ra(!1)},onBlur:t=>yi(void 0,t.target.value)})):null,n==="mbti"?null:p("div",{key:"actions",className:"mp-actions"},p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginRight:8},onClick:gn,title:"用固定示例盘看完整报告(不改动你已填的数据)"},"看示例"),p("button",{className:"mp-btn",onClick:hi,title:"时间仍为自动时,点它会取当下再起卦"},n==="tarot"?"抽牌":n==="bazi"||n==="ziwei"?"排盘":n==="hepan"?"合盘":n==="qimen"?"起局":ba.indexOf(n)>=0?"看结果":"起卦"))),p("div",{key:"hint",className:"mp-hint"},ln.hint),ke.length?p("div",{key:"hist",className:"mp-hist"},p("div",{className:"mp-hist-h"},p("span",null,"最近排过"),p("button",{className:"mp-hist-clear",onClick:Hn},"清空")),p("div",{className:"mp-hist-list"},ke.map((t,g)=>p("button",{key:g,className:"mp-hist-item",title:`${String(t.date||"")} ${t.hourUnknown?"时辰未知":String(t.time||"")}`,onClick:()=>_n(t)},p("b",null,(He.find(N=>N.k===t.kind)||{}).label||t.kind),p("span",null,t.label||"—"),p("i",null,`${String(t.date||"").slice(5)} ${t.hourUnknown?"时辰未知":String(t.time||"")}`))))):null,Ee==="cast"&&mi?p("div",{key:"auto",className:"mp-auto"},Na.cast?`起卦时刻用的是你手动填的(${V});想跟随当下,把时间改回或清空即可。`:`起卦时刻已自动取本机时间(${V}),每次点起卦都会重新取当下;想固定时刻就在上面改。`):null,gt?p("div",{key:"err",className:"mp-err",role:"alert"},gt):null,ni?p("div",{key:"ntc",className:"mp-note",role:"status"},ni):null,sn?p("div",{key:"load",className:"mp-note",role:"status"},"正在加载本页需要的引擎…"):null,!f&&!gt?p("div",{key:"empty",className:"mp-empty"},p("b",null,n==="ziwei"||n==="bazi"?"填好出生信息,点「排盘」":n==="tarot"?"写下想问的事,点「抽牌」":n==="mbti"?"按 1–5 给题目打分,答满 12 题就能看结果":ba.indexOf(n)>=0?"填好参数,点「看结果」":"写下所问之事,点「起卦」"),n==="ziwei"||n==="bazi"?"出生日期、时刻与性别即可;出生地只影响真太阳时。":n==="mbti"?"4 题一页,答案只在本地参与计算,不会上传。":ba.indexOf(n)>=0?"按上面的选项填好参数即可;全部在本机计算,不上传。":"起卦时刻已自动取当下,也可以手动改。"):null,f?p("div",{key:"card",className:"mp-card mp-flat",role:"region","aria-label":"排盘结果","aria-live":"polite",onClick:zn,dangerouslySetInnerHTML:{__html:jn(f)+B.perfHTML(le)+B.revisionHTML(f.r.revision)+B.handleHTML(f.r.handle)+B.shadowHTML(f.r.shadow,f.shadowDiff)+B.traceHTML(f.r.trace,f.r.system,f.r.traceText)+B.resultWithInterpret(f.kind==="ziwei"?B.ziweiHTML(f.r):f.kind==="bazi"?B.baziHTML(f.r)+(f.trend?B.trendHTML(f.trend,{brief:!1}):""):f.kind==="meihua"?B.meihuaHTML(f.r):f.kind==="daliuren"?B.daliurenHTML(f.r):f.kind==="qimen"?B.qimenHTML(f.r)+B.qimenFactsHTML(f.r):f.kind==="hepan"?f.r.chart==="ziwei"?B.ziweiHepanHTML(f.r):B.hepanHTML(f.r):f.kind==="tarot"?B.tarotHTML(f.r):f.kind==="liuyao"?B.liuyaoHTML(f.r):f.kind==="chenggu"?B.chengguHTML(f.r):f.kind==="almanac"?B.almanacHTML(f.r):f.kind==="zeri"?B.zeriHTML(f.r):f.kind==="trend"?B.trendHTML(f.r):f.kind==="name"?B.nameHTML(f.r):f.kind==="mbti"?B.mbtiHTML(f.r):f.kind==="fengshui"?B.fengshuiHTML(f.r):B.quickHTML(f.r),f.it,{folded:hn()})+B.caliberHTML(f.caliber)}}):null,f?p("div",{key:"bar",className:"mp-bar"},p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px"},onClick:qn},pn||"复制文字结果"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:Cn,title:"导出盘面 + 解析(含一页读懂、三张表)为 Markdown"},"导出 .md"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:Tn,title:"生成 PNG 摘要卡(一页读懂 + 首张表),适合直接分享"},"存为摘要长图")):null,f?p("div",{key:"ask",className:"mp-askbox",style:{flexWrap:"wrap"}},p("input",{className:"mp-input",value:Je,maxLength:120,placeholder:"追问:如 2027 年事业怎么样(回车提交)",onChange:t=>wa(t.target.value),onKeyDown:t=>{t.key==="Enter"&&$i()}}),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px"},onClick:$i},"追问"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:Nn,title:"把这张盘的摘要和你的问题一起发进 DSH 对话窗,由对话里的模型接着答"},"问进对话"),W.ref?null:p("div",{key:"bridgediag",className:"mp-note",style:{marginTop:6,fontSize:11,flexBasis:"100%"}},Ka()),Rt?p("div",{key:"chatnote",className:"mp-note",style:{marginTop:6,fontSize:12,flexBasis:"100%"}},Rt):null):null,f?p("div",{key:"bridge",className:"mp-bridge"},p("span",{className:"mp-bridge-lbl"},W.ref?"桥可用;也可以:":"桥未就绪,改走这几档:"),bi.map(([t,g,N])=>p("button",{key:t,type:"button",className:"mp-chip","data-bridge-copy":t,title:N,onClick:E=>wn(t,E.currentTarget)},g))):null,Ie?p("div",{key:"fx",className:"mp-fx",dangerouslySetInnerHTML:{__html:B.followupHTML(Ie)}}):null,f&&f.kind==="bazi"&&f.r.past?p("div",{key:"verify",className:"mp-verify"},p("div",{className:"mp-verify-h"},"验前事 · 过去几年的信号(只读,不改盘)"),f.r.past.rows.map(t=>p("div",{key:t.year,className:"mp-verify-row"},p("span",{className:"mp-verify-txt"},`${t.year} ${t.ganzhi} · ${t.theme}`),p("span",{className:"mp-verify-btns"},["yes","no","unsure"].map(g=>p("button",{key:g,className:"mp-chip"+(It[t.year]===g?" on":""),onClick:()=>et(Object.assign({},It,{[t.year]:g}))},g==="yes"?"准":g==="no"?"不准":"不确定"))))),p("div",{className:"mp-verify-foot"},p("button",{className:"mp-btn ghost",style:ki,onClick:Ln},"算贴合度"),rt?p("span",{className:"mp-verify-fit"},`命中 ${rt.yes}/${rt.answered}(${rt.level}):${rt.advice}`):null)):null,f&&f.kind==="bazi"?p("div",{key:"rect",className:"mp-rect"},p("div",{className:"mp-verify-h"},"生时校正 · 用过去的事反推时辰"),pt.map((t,g)=>p("div",{key:g,className:"mp-rect-row"},p("input",{className:"mp-input",type:"number",min:1900,max:2100,value:t.year,onChange:N=>aa(pt.map((E,y)=>y===g?Object.assign({},E,{year:N.target.value}):E))}),p("select",{className:"mp-input",value:t.kind,onChange:N=>aa(pt.map((E,y)=>y===g?Object.assign({},E,{kind:N.target.value}):E))},[["career","事业变动"],["wealth","财运"],["love","感情"],["move","搬迁/出行"],["health","健康"],["other","其他"]].map(([N,E])=>p("option",{key:N,value:N},E))))),p("button",{className:"mp-btn ghost",style:ki,onClick:En},"计算候选时辰"),tt?tt.error?p("div",{className:"mp-rect-err"},tt.error):p("div",{className:"mp-rect-out"},p("div",{className:"mp-verify-fit"},tt.note),tt.candidates.slice(0,6).map(t=>p("div",{key:t.hour,className:"mp-rect-cand"+(t===tt.best?" best":"")},`${t.label} · 时柱 ${t.hourGanzhi} · 日柱 ${t.dayGanzhi} · 命中 ${t.hits}/${t.total}`))):null):null,!f&&!gt?p("div",{key:"ph",className:"mp-dim",style:{marginTop:24,fontSize:12}},"选择体系后点「排盘」。所有计算在本机完成,不上传任何数据。"):null,p("div",{key:"fb",className:"mp-fb"},p("div",{className:"mp-fb-h"},p("span",{className:"mp-fb-t"},"用得不对、读不懂、或算得跟别家不一样?"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"4px 10px"},onClick:wi,title:"生成一份含输入、版本、环境与结果摘要的报告,粘贴到 issue / 邮件 / 群聊即可"},de||"复制反馈报告"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"4px 10px",marginLeft:6},onClick:()=>An(),title:"在浏览器打开 GitHub issue(报告已复制到剪贴板,粘进去即可)"},"开 issue")),p("div",{className:"mp-fb-b"},"邮件 1129440028@qq.com · GitHub issues · 微信群 dsh-metaphysics",x?p("span",{className:"mp-fb-note"}," "+x):null))];return p("div",{className:"mp-wrap"},Gn)}function Qi(n){try{if(typeof styles<"u"&&styles&&typeof styles.insert=="function")return styles.insert(n)}catch(s){console.error("[metaphysics] styles.insert 不可用,改用 DOM 注入",s)}try{const s=document.createElement("style");return s.setAttribute("data-plugin","@local/metaphysics"),s.textContent=n,document.head.appendChild(s),()=>s.remove()}catch(s){return console.error("[metaphysics] DOM 注入样式也失败",s),()=>{}}}let Qa=!1;function ya(){try{const n=document.documentElement;if(!n||!document.body)return;const s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;pointer-events:none;background:var(--dsw-alias-brand-primary)",document.body.appendChild(s);const q=getComputedStyle(s).backgroundColor;s.remove();const P=Me&&typeof Me.pickOnColor=="function"?Me.pickOnColor(q):"";P&&n.style&&n.style.getPropertyValue("--mp-on-brand")!==P&&n.style.setProperty("--mp-on-brand",P)}catch{}}function en(){if(!Qa){Qa=!0,ya();try{const n=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");n&&typeof n.addEventListener=="function"&&n.addEventListener("change",ya)}catch{}try{typeof MutationObserver=="function"&&document.documentElement&&new MutationObserver(ya).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]})}catch{}}}function tn(n){try{const F=Qi(Pi+(B&&B.CSS?B.CSS:""));typeof n.effect=="function"&&typeof F=="function"&&n.effect(()=>F)}catch(F){console.error("[metaphysics] 样式注入失败",F)}try{en()}catch(F){console.error("[metaphysics] 字色同步失败",F)}let s=null;try{s=n&&n.slots||(n&&typeof n.get=="function"?n.get("slots"):null)}catch(F){console.error("[metaphysics] 取 slots 服务失败",F)}if(!s||typeof s.register!="function"){console.error("[metaphysics] slots 服务不可用,面板未注册");return}try{W.injectType=typeof s.inject;const F=typeof s.spec=="function"?s.spec("conversation.input.right"):null;W.spec=F?F.kind+"/"+F.scope:"未声明"}catch(F){W.spec="取声明失败",Ya(F)}const q=F=>{if(typeof F=="function")return F;if(F&&typeof F=="object"){for(const fe of["dispose","off","cancel","unregister"])if(typeof F[fe]=="function")return()=>{try{F[fe]()}catch{}}}return()=>{}},P=(F,fe)=>{try{const he=s.register(F,fe);return W.regs+=1,W.seatOk[F.name]=!0,q(he)}catch(he){return Ya(he),()=>{}}},V=(F,fe)=>{const he=()=>{const G=fe();return W.contribution=(W.contribution?W.contribution+",":"")+(F+(typeof G=="function"?" 已挂上":" 未挂上")),G};try{typeof s.inject=="function"?s.inject(F,he):he()}catch(G){console.error("[metaphysics] 等待槽位失败:"+F,G);try{he()}catch(Z){console.error("[metaphysics] 直接注册也失败:"+F,Z)}}};V("sidebar.panellist",()=>P({name:"sidebar.panellist",id:"metaphysics",order:20,label:()=>"命理 v"+(window.__MP_VER||"")},Ui)),V("main",()=>P({name:"main",key:"metaphysics"},F=>p(Zi,null,p(Ji,F))));const ee=(F,fe)=>{const he=()=>{try{const Z=s.inject(F,fe);return W.contribution=(W.contribution?W.contribution+",":"")+(F.replace("conversation.","")+(typeof Z=="function"?" 已挂上":" 未挂上")),Z}catch(Z){console.error("[metaphysics] 槽位注册失败:"+F,Z);try{return fe()}catch(R){console.error("[metaphysics] 直接注册也失败:"+F,R);return}}};let G;try{typeof n.effect=="function"?G=n.effect(he,"metaphysics: "+F):G=he()}catch(Z){console.error("[metaphysics] effect 包裹失败:"+F,Z),G=he()}typeof G=="function"&&W.seatDisposers.push(G)};ee("conversation.input.right",()=>P({name:"conversation.input.right",id:"metaphysics-ask",order:40},Xa)),ee("conversation.composer.dock",()=>P({name:"conversation.composer.dock",id:"metaphysics-dock",order:60},Wa));let ae=!1;const se=()=>{W.ref||ae||(ae=!0,W.seatOk["conversation.input.right"]||P({name:"conversation.input.right",id:"metaphysics-ask",order:40},Xa),W.seatOk["conversation.composer.dock"]||P({name:"conversation.composer.dock",id:"metaphysics-dock",order:60},Wa))};let a=20;const ge=()=>!!(W.seatOk["conversation.input.right"]&&W.seatOk["conversation.composer.dock"]),ze=()=>{W.ref||a<=0||ge()||(a-=1,se(),!ge()&&setTimeout(ze,700))};try{setTimeout(ze,700)}catch{}try{document.addEventListener("pointerdown",()=>{ae=!1,se()},{once:!0,capture:!0})}catch{}}return{inject:["slots"],apply(n){try{tn(n)}catch(s){console.error("[metaphysics] apply 异常",s)}}}}});
|
|
2237
|
+
`)),t.push("```"),b.r.handle&&(t.push(""),t.push("排盘句柄(开发者可据此复现同一张盘):`"+b.r.handle+"`"))}else t.push("### 结果摘要"),t.push(""),t.push("(这次没有生成盘面——如果是在排盘过程中出错,上面的「报错原文」就是关键。)");return t.push(""),t.push("## 联系渠道"),t.push(""),t.push("- GitHub issue:https://github.com/xuanfu-web/dsh-metaphysics/issues"),t.push("- 邮件:1129440028@qq.com"),t.push("- 微信群:dsh-metaphysics"),t.join(`
|
|
2238
|
+
`)},zi=()=>{const t=Mn();try{if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(t).then(()=>{Y("已复制"),re("粘到 issue / 邮件 / 群里即可")}).catch(()=>{Y("复制失败"),re("可改用「导出 .md」或手动选中")});else{const g=document.createElement("textarea");g.value=t,g.style.cssText="position:fixed;left:-9999px;top:0",document.body.appendChild(g),g.select();const N=document.execCommand&&document.execCommand("copy");g.remove(),Y(N?"已复制":"复制失败"),re(N?"粘到 issue / 邮件 / 群里即可":"可改用「导出 .md」或手动选中")}}catch{Y("复制失败"),re("可改用「导出 .md」")}setTimeout(()=>{Y(""),re("")},4e3)},Cn=()=>{try{zi()}catch{}const t=encodeURIComponent("[反馈] "+(He.find(g=>g.k===s)?.label||s)+(ut?":报错":":使用问题"));try{window.open("https://github.com/xuanfu-web/dsh-metaphysics/issues/new?title="+t,"_blank","noopener")}catch{re("浏览器拦了弹窗,请手动打开 GitHub issues")}},An=()=>{if(!(!b||!b.r))try{const t=U.renderText?U.renderText(b.r):b.r.summary||"",g=new Blob([t],{type:"text/markdown;charset=utf-8"}),N=document.createElement("a");N.href=URL.createObjectURL(g),N.download=`命理报告-${b.r.system}.md`,document.body.appendChild(N),N.click(),N.remove(),setTimeout(()=>URL.revokeObjectURL(N.href),2e3)}catch(t){console.error("[metaphysics] 导出失败",t)}},Tn=()=>{if(!(!b||!b.r))try{const t=B.summaryCardPNG?B.summaryCardPNG(b.r,b.it):"";if(!t){ft("当前环境不支持 Canvas 导出");return}const g=document.createElement("a");g.href=t,g.download=`命理摘要-${b.r.system}.png`,document.body.appendChild(g),g.click(),g.remove()}catch(t){console.error("[metaphysics] 长图导出失败",t)}},ji={fontSize:12,padding:"5px 12px"},Ln=()=>{!b||!b.r||!b.r.past||at(U.verifyFit?U.verifyFit(b.r.past.rows,De):null)},En=()=>{if(!(!b||b.kind!=="bazi"))try{const t=b.at||{date:q,time:V},[g,N,_]=String(t.date).split("-").map(Number),[,v]=String(t.time).split(":").map(Number),se=qt.filter(ye=>Number(ye.year)).map(ye=>({year:Number(ye.year),kind:ye.kind}));Zt(U.rectifyBirth?U.rectifyBirth({base:{year:g,month:N,day:_,minute:Number.isFinite(v)?v:0},gender:b.gender||a,events:se,lateZi:typeof b.lateZi=="boolean"?b.lateZi:tt,trueSolar:typeof b.trueSolar=="boolean"?b.trueSolar:Ze,address:String(b.address||"").trim()||void 0}):{error:"当前客户端未加载生时校正模块"})}catch(t){Zt({error:t&&t.message?t.message:String(t)})}},Q=(t,g)=>p("label",{className:"mp-field"},p("span",{className:"mp-lbl"},t),g),_n=t=>{n(t.kind),t.date&&D(t.date),t.time&&te(t.time),oe(!!t.hourUnknown),t.gender&&fe(t.gender),O(t.address||""),typeof t.trueSolar=="boolean"&&ot(t.trueSolar),typeof t.lateZi=="boolean"&&jt(t.lateZi),Ve(t.lines||""),Na(t.question||""),pi(t.direction||"general"),ri(t.count||"3"),di(t.mhMode||"time"),ci(t.upper||""),mi(t.lower||""),ui(t.changing||""),t.kind==="qimen"&&(typeof t.qimenRule=="string"&&Ft(t.qimenRule),typeof t.qLateZi=="string"&&ta(t.qLateZi)),t.kind==="zeri"&&(typeof t.task=="string"&&na(t.task),t.days!=null&&sa(String(t.days)),typeof t.shengXiao=="string"&&Se(t.shengXiao),typeof t.zCand=="string"&&Nt(t.zCand)),t.kind==="xiaoliuren"&&(r(t.xlrMode==="number"?"number":"time"),t.num1!=null&&o(String(t.num1)),t.num2!=null&&d(String(t.num2)),t.num3!=null&&u(String(t.num3))),t.kind==="trend"&&t.toAge!=null&&j(String(t.toAge)),t.kind==="fengshui"&&(typeof t.fsMode=="string"&&J(t.fsMode),t.fsPeriod!=null&&w(String(t.fsPeriod)),typeof t.sitting=="string"&&ae(t.sitting),typeof t.facing=="string"&&pe(t.facing)),t.kind==="name"&&(typeof t.nnMode=="string"&&me(t.nnMode),typeof t.surname=="string"&&H(t.surname),typeof t.givenName=="string"&&$e(t.givenName),t.limitN!=null&&de(String(t.limitN))),t.kind==="convert"&&(typeof t.convMode=="string"&&Mt(t.convMode),typeof t.lunarDate=="string"&&oa(t.lunarDate),typeof t.leapMonth=="boolean"&&e(t.leapMonth)),t.kind==="hepan"&&(t.hpChart&&Et(t.hpChart),typeof t.partnerDate=="string"&&xe(t.partnerDate),typeof t.partnerTime=="string"&&Z(t.partnerTime),typeof t.partnerGender=="string"&&K(t.partnerGender),typeof t.partnerAddress=="string"&&$t(t.partnerAddress),typeof t.thirdOn=="boolean"&&_t(t.thirdOn),typeof t.p2Date=="string"&&Ht(t.p2Date),typeof t.p2Time=="string"&&za(t.p2Time),typeof t.p2Gender=="string"&&kt(t.p2Gender),typeof t.p2Address=="string"&&Ot(t.p2Address)),da(!1),ai(t)},Hn=()=>{ne([]),Pa([])},On=["bazi","ziwei","trend","chenggu"],qi=t=>{n(t.kind),D(t.date),t.time&&te(t.time),oe(!!t.hourUnknown),t.gender&&fe(t.gender),O(t.address||""),ot(t.trueSolar!==!1),jt(t.lateZi!==!1)},Fn=t=>{const g=B.profEvent(t.target);if(!g)return;const N=v=>ii.find(se=>se.id===v),_=t.currentTarget.querySelector(".mp-prof-name");if(si(""),g.action==="use"){const v=N(g.id);if(!v)return;if(!B.profUsable(v)){Me("这张档案没有出生时刻,先补上时刻再存一次。");return}Qe="",ra(B.profilesTouch(v.id)),qi(v),je(v.kind,{date:v.date,time:v.hourUnknown?"12:00":v.time},void 0,{gender:v.gender||void 0,address:v.address||"",hourUnknown:!!v.hourUnknown,trueSolar:v.trueSolar!==!1,lateZi:v.lateZi!==!1});return}if(g.action==="edit"){const v=N(g.id);if(!v)return;qi(v),Qe=v.label,pa(v.id);return}if(g.action==="cancel"){Qe="",pa(null);return}if(g.action==="pin"){ra(B.profilesPin(g.id));return}if(g.action==="del"){if(ni!==g.id){si(g.id);return}ra(B.profilesRemove(g.id)),Ut===g.id&&(Qe="",pa(null)),Me("已从本机删除这张档案卡(不影响已经排出来的盘)。");return}if(g.action==="put"){const v=Ut,se=B.profFromForm({kind:s,date:q,time:V,hourUnknown:ie,gender:a,address:ze,trueSolar:Ze,lateZi:tt},_?_.value:Qe,Ut||void 0);if(!se){Me("先填好出生日期(和时刻),再存档案。");return}const ye=B.profilesPut(se);if(!ye.ok){Me("档案没能存进本机(存储被禁用或已满),排盘不受影响。");return}ra(ye.list),Qe="",pa(null),_&&(_.value=""),Me(`${v?"已更新档案":"已存入我的命盘"}「${ye.item.label}」。`)}},Dn=t=>{const g=t.target&&t.target.closest?t.target.closest(".mp-prof-name"):null;g&&(Qe=g.value)},Pn=t=>{const g=U.formOf?U.formOf(t):null;if(!g){je("ziwei");return}const N=He.some(ye=>ye.k===g.tab)?g.tab:"ziwei",_={date:g.date||q,time:g.time||V},v=g.lines===void 0?void 0:Array.isArray(g.lines)?g.lines.join(" "):String(g.lines);g.date&&D(g.date),g.time&&te(g.time),g.gender&&fe(g.gender),typeof g.address=="string"&&O(g.address),typeof g.trueSolar=="boolean"&&ot(g.trueSolar),typeof g.lateZi=="boolean"&&jt(g.lateZi),v!==void 0&&Ve(v),g.question&&Na(g.question),n(N);const se=U.restNote?U.restNote(g):"";Ae(`已按深链还原:${t.label}${g.question?`|${g.question}`:""}${se?` ${se}`:""}`),je(N,_,void 0,{gender:g.gender,address:g.address,trueSolar:g.trueSolar,lateZi:g.lateZi,lines:v,question:g.question})};bt(()=>{let t=!1;const g=Re;return(async()=>{let N=null;try{await va(s);const _=typeof location<"u"?String(location.href):"";_&&_.indexOf("mp=")>=0&&window.Engine&&window.Engine.parseAskLink&&(N=window.Engine.parseAskLink(_))}catch{N=null}if(!(t||Re!==g)){if(N&&N.ok)try{Pn(N);return}catch{}je("ziwei")}})(),()=>{t=!0}},[]),bt(()=>{if(!qa)return;const t=qa.kind;ai(null),je(t)},[qa]),bt(()=>{const t=g=>{if(g.key!=="Escape")return;const N=document.getElementById("mp-trace-layer");N&&N.classList.contains("open")&&$i()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[]);const Si=(ke||[]).filter(t=>t&&He.some(g=>g.k===t.tab)).slice(0,Za),Rn=t=>(He.find(g=>g.k===t)||{}).label||t,In=({k:t,label:g,tip:N,wide:_})=>p("button",{key:t,type:"button",className:"mp-tool"+(_?" wide":"")+(s===t?" on":""),"data-tab":t,onClick:()=>Aa(t)},p("b",null,g),p("span",null,N)),Gn=[p("div",{key:"profiles",className:"mp-profwrap",onClick:Fn,onInput:Dn,dangerouslySetInnerHTML:{__html:B.profilesHTML(ii,{editingId:Ut,armedDel:ni,bar:On.indexOf(s)>=0?B.profilesBarHTML({editingId:Ut,name:Qe}):""})}}),p("section",{key:"start",className:"mp-start","aria-label":"选择要算的事"},p("div",{className:"mp-start-top"},p("div",{className:"mp-recent",hidden:Si.length===0},p("span",{className:"mp-recent-lbl"},"最近用过"),p("span",{className:"mp-recent-list"},Si.map(t=>p("button",{key:t.tab,type:"button",className:"mp-rc",onClick:()=>Aa(t.tab)},Rn(t.tab),p("i",null,Xi(t.at)))))),p("div",{className:"mp-viewsw",role:"group","aria-label":"首屏视图"},p("button",{type:"button",className:be==="group"?"on":"","aria-pressed":be==="group"?"true":"false",onClick:()=>xi("group")},"分组"),p("button",{type:"button",className:be==="flat"?"on":"","aria-pressed":be==="flat"?"true":"false",onClick:()=>xi("flat")},"平铺"))),be==="group"?p("div",{className:"mp-groups"},Vi.map(t=>{const g=!!mt[t.title],N=Math.max(0,t.items.length-4);return p("section",{key:t.title,className:"mp-tgroup"+(g?" open":"")},p("div",{className:"mp-tgroup-head"},p("h2",null,t.title),p("p",null,t.hint)),p("div",{className:"mp-ttools"},t.items.map(In),N>0?p("button",{key:"more",type:"button",className:"mp-tmore","aria-expanded":g?"true":"false",onClick:()=>ja(_=>Object.assign({},_,{[t.title]:!g}))},g?"收起":`还有 ${N} 个`):null))})):null),p("div",{key:"tabs",className:"mp-tabs"+(be==="flat"?"":" hide"),role:"tablist","aria-label":"命理体系"},He.map(t=>p("button",{key:t.k,role:"tab","aria-selected":s===t.k?"true":"false",tabIndex:s===t.k?0:-1,className:"mp-tab"+(s===t.k?" on":""),onClick:()=>Aa(t.k)},t.label))),p("div",{key:"head",className:"mp-panel"},p("div",{className:"mp-row"},fi?Q(Kt?"出生日期(公历)":Ee==="date"?"日期(公历)":"起卦日期(公历)",p(ya,{value:q,onChange:mn,onInvalid:()=>Me("日期请按「年-月-日」填写,例如 1990-05-12。")})):null,hi?Q(Kt?"出生时刻":"起卦时刻",p("input",{className:"mp-input",type:"time",value:V,disabled:ie&&(s==="bazi"||s==="trend"),onChange:t=>un(t.target.value)})):null,s==="bazi"||s==="trend"?p("label",{className:"mp-chk",title:"不知道出生时辰时勾这里:不排时柱,起运按日估算,结果首行会写明"},p("input",{type:"checkbox",checked:ie,onChange:t=>oe(t.target.checked)})," 时辰未知"):null,Kt?Q("性别",p("select",{className:"mp-input",value:a,onChange:t=>fe(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,Kt?Q("出生地(省/市即可)",p("input",{className:"mp-input",placeholder:"如 河北石家庄 / 成都",value:ze,onChange:t=>O(t.target.value)})):null,s==="bazi"||s==="ziwei"?p("label",{className:"mp-field mp-checks"},p("input",{type:"checkbox",checked:Pt,onChange:t=>Rt(t.target.checked)}),p("span",{className:"mp-lbl"},"八字 × 紫微 交叉验证")):null,s==="hepan"?Q("对方出生日期",p(ya,{value:he,onChange:xe,onInvalid:()=>Me("对方出生日期请按「年-月-日」填写,例如 1992-08-15。")})):null,s==="hepan"?Q("对方出生时刻",p("input",{className:"mp-input",type:"time",value:G,onChange:t=>Z(t.target.value)})):null,s==="hepan"?Q("对方性别",p("select",{className:"mp-input",value:R,onChange:t=>K(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,s==="hepan"?Q("合盘方式",p("div",{className:"mp-seg"},p("button",{className:Ge==="bazi"?"on":"",onClick:()=>Et("bazi")},"八字"),p("button",{className:Ge==="ziwei"?"on":"",onClick:()=>Et("ziwei")},"紫微"))):null,s==="hepan"?Q("对方出生地(可空)",p("input",{className:"mp-input",placeholder:"如 四川成都",value:ve,onChange:t=>$t(t.target.value)})):null,s==="hepan"?p("label",{className:"mp-field mp-checks"},p("input",{type:"checkbox",checked:Oe,onChange:t=>_t(t.target.checked)}),p("span",{className:"mp-lbl"},"三方合盘(加入第三人)")):null,s==="hepan"&&Oe?Q("第三方出生日期",p(ya,{value:Be,onChange:Ht,onInvalid:()=>Me("第三方出生日期请按「年-月-日」填写,例如 1990-01-01。")})):null,s==="hepan"&&Oe?Q("第三方出生时刻",p("input",{className:"mp-input",type:"time",value:et,onChange:t=>za(t.target.value)})):null,s==="hepan"&&Oe?Q("第三方性别",p("select",{className:"mp-input",value:wt,onChange:t=>kt(t.target.value)},p("option",{value:"female"},"女"),p("option",{value:"male"},"男"))):null,s==="hepan"&&Oe?Q("第三方出生地(可空)",p("input",{className:"mp-input",placeholder:"如 广东广州",value:Fe,onChange:t=>Ot(t.target.value)})):null,s==="qimen"?p("fieldset",{key:"qmr",className:"mp-qmrule"},p("legend",{className:"mp-lbl"},"换局规则"),p("div",{className:"mp-qmopts",role:"radiogroup","aria-label":"奇门换局规则"},[["chaibu","拆补"],["chaoshen","超神接气"],["zhirun","置闰"]].map(([t,g])=>p("label",{key:t,className:"mp-qmopt"},p("input",{type:"radio",name:"qimen_rule",value:t,checked:zt===t,onChange:()=>Ft(t)}),p("span",null,g)))),p("div",{className:"mp-field"},p("span",{className:"mp-lbl"},"晚子时"),p("select",{className:"mp-input",value:Dt,onChange:t=>ta(t.target.value)},p("option",{value:"same-day"},"23:00 后归当日"),p("option",{value:"next-day"},"23:00 后归次日"))),p("details",{className:"mp-qmhelp"},p("summary",null,"三种规则有什么区别?"),p("p",null,"决定符头与节气如何对齐、是否插入闰局;同一个时刻在不同规则下可能得到不同局数。默认「拆补」与工具层一致。"))):null,Ie(s)||s==="qimen"?Q(s==="qimen"?"询问方向(定用神)":"询问方向",p("select",{className:"mp-input",value:Le,onChange:t=>{pi(t.target.value),wi(t.target.value)}},(U.DIRECTIONS||[]).map(t=>p("option",{key:t.key,value:t.key},t.label)))):null,s==="tarot"?Q("张数",p("select",{className:"mp-input",value:Sa,onChange:t=>ri(t.target.value)},p("option",{value:"1"},"1 张 · 指引"),p("option",{value:"3"},"3 张 · 过去现在未来"),p("option",{value:"5"},"5 张 · 十字牌阵"))):null,s==="liuyao"?Q("六爻(可空)",p("input",{className:"mp-input",placeholder:"空则随机,如 9 7 8 8 7 6",value:Ye,onChange:t=>Ve(t.target.value)})):null,s==="meihua"?Q("起卦方式",p("div",{className:"mp-seg"},p("button",{className:gt==="time"?"on":"",onClick:()=>vi("time")},"时间"),p("button",{className:gt==="number"?"on":"",onClick:()=>vi("number")},"数字"))):null,s==="meihua"&>==="number"?Q("第一个数",p("input",{className:"mp-input",value:ca,placeholder:"如 17",onChange:t=>ci(t.target.value)})):null,s==="meihua"&>==="number"?Q("第二个数",p("input",{className:"mp-input",value:ma,placeholder:"如 29",onChange:t=>mi(t.target.value)})):null,s==="meihua"&>==="number"?Q("动爻(可空)",p("input",{className:"mp-input",value:ua,placeholder:"1-6",onChange:t=>ui(t.target.value)})):null,s==="zeri"?Q("所办事项",p("select",{className:"mp-input",value:St,onChange:t=>na(t.target.value)},[["常用",["嫁娶","搬家入宅","出行","开业","签订合同","祭祀"]],["婚嫁",["嫁娶","订婚","领证","提亲","收送聘金","满月酒"]],["生活",["搬家","入宅","旅行","访亲友","入学","求医","祭祀"]],["建造",["动土","装修","装修建造","安葬","试车买车"]],["工商",["开业","交易","投资","签订合同","签约","纳财","赴任"]]].map(([t,g])=>p("optgroup",{key:t,label:t},g.map(N=>p("option",{key:`${t}-${N}`,value:N},N)))))):null,s==="convert"?Q("转换方向",p("div",{className:"mp-seg"},p("button",{className:Te==="solar2lunar"?"on":"",onClick:()=>Mt("solar2lunar")},"公历 → 农历"),p("button",{className:Te==="lunar2solar"?"on":"",onClick:()=>Mt("lunar2solar")},"农历 → 公历"))):null,s==="convert"&&Te==="lunar2solar"?Q("农历日期",p("input",{className:"mp-input",value:dt,placeholder:"如 2026-9-17",onChange:t=>oa(t.target.value)})):null,s==="convert"&&Te==="lunar2solar"?p("label",{className:"mp-check"},p("input",{type:"checkbox",checked:Ct,onChange:t=>e(t.target.checked)})," 闰月"):null,s==="zeri"?Q("看多少天",p("input",{className:"mp-input",type:"number",min:1,max:60,value:lt,onChange:t=>sa(t.target.value)})):null,s==="zeri"?Q("候选日(可空,只比这几天)",p("input",{className:"mp-input",placeholder:"如 2026-12-01, 2026-12-08, 2026-12-15",value:Pe,onChange:t=>Nt(t.target.value)})):null,s==="zeri"?Q("当事人属相(可空)",p("select",{className:"mp-input",value:it,onChange:t=>Se(t.target.value)},p("option",{value:""},"不排除"),["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"].map(t=>p("option",{key:t,value:t},t)))):null,s==="xiaoliuren"?Q("起课方式",p("div",{className:"mp-seg"},p("button",{className:i==="time"?"on":"",onClick:()=>r("time")},"时间"),p("button",{className:i==="number"?"on":"",onClick:()=>r("number")},"报数"))):null,s==="xiaoliuren"&&i==="number"?Q("第一个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:l,onChange:t=>o(t.target.value)})):null,s==="xiaoliuren"&&i==="number"?Q("第二个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:c,onChange:t=>d(t.target.value)})):null,s==="xiaoliuren"&&i==="number"?Q("第三个数",p("input",{className:"mp-input",type:"number",min:1,max:99,value:m,onChange:t=>u(t.target.value)})):null,s==="mbti"?p("div",{className:"mp-quiz-wrap"},p("div",{className:"mp-lbl"},"十六型人格问卷 · 4 题一页,按 1(完全不像)到 5(很像我)打分"),p(Ui,{answers:f,page:E,onPick:(t,g)=>x(N=>{const _=N.slice();return _[t]=g,_}),onPage:t=>S(g=>Math.max(0,Math.min(g+t,Math.max(0,Math.ceil(ea().total/Jt)-1)))),onSubmit:bi,onClear:()=>{x(new Array(ea().total).fill(null)),S(0),A(null)}})):null,s==="trend"?Q("算到几岁",p("input",{className:"mp-input",type:"number",min:10,max:100,value:L,onChange:t=>j(t.target.value)})):null,s==="fengshui"?Q("看什么",p("div",{className:"mp-seg"},p("button",{className:M==="natal"?"on":"",onClick:()=>J("natal")},"命卦"),p("button",{className:M==="advise"?"on":"",onClick:()=>J("advise")},"门主灶"),p("button",{className:M==="xuankong"?"on":"",onClick:()=>J("xuankong")},"玄空"))):null,s==="fengshui"&&M!=="natal"?Q("坐山(24 山)",p("input",{className:"mp-input",value:z,placeholder:"如 子 / 乾",onChange:t=>ae(t.target.value)})):null,s==="fengshui"&&M!=="natal"?Q("朝向(24 山)",p("input",{className:"mp-input",value:F,placeholder:"如 午 / 巽",onChange:t=>pe(t.target.value)})):null,s==="fengshui"&&M==="xuankong"?Q("运(1–9)",p("input",{className:"mp-input",type:"number",min:1,max:9,value:P,onChange:t=>w(t.target.value)})):null,s==="name"?Q("看什么",p("div",{className:"mp-seg"},p("button",{className:$==="assess"?"on":"",onClick:()=>me("assess")},"评名字"),p("button",{className:$==="generate"?"on":"",onClick:()=>me("generate")},"生成候选"))):null,s==="name"?Q("姓",p("input",{className:"mp-input",value:k,placeholder:"如 李",onChange:t=>H(t.target.value)})):null,s==="name"&&$==="assess"?Q("名字",p("input",{className:"mp-input",value:ee,placeholder:"如 沐宸",onChange:t=>$e(t.target.value)})):null,s==="name"&&$==="generate"?Q("候选个数",p("input",{className:"mp-input",type:"number",min:1,max:20,value:ue,onChange:t=>de(t.target.value)})):null),Kt?p("div",{className:"mp-checks"},p("label",{title:"按出生地经度把钟表时间换算成真太阳时"},p("input",{type:"checkbox",checked:Ze,onChange:t=>ot(t.target.checked)}),"真太阳时"),p("label",{title:"23:00–23:59 出生时:勾选=按次日日柱起时柱;不勾=仍用当日日柱"},p("input",{type:"checkbox",checked:tt,onChange:t=>jt(t.target.checked)}),"晚子时换日"),p("label",{title:"开启后会请求 OpenStreetMap,把区县/村落到更精确的坐标"},p("input",{type:"checkbox",checked:ge,onChange:t=>Ke(t.target.checked)}),"联网精确到区县")):null,Ie(s)?p("div",{className:"mp-askblock"},p("span",{className:"mp-lbl"},"所问之事(必填)"),p("textarea",{className:"mp-textarea"+(rn?" invalid":""),rows:2,value:nt,placeholder:"用一句话描述所问之事,例如:今年是否适合换工作?",onChange:t=>{Na(t.target.value),da(!1)},onBlur:t=>wi(void 0,t.target.value)})):null,s==="mbti"?null:p("div",{key:"actions",className:"mp-actions"},p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginRight:8},onClick:gn,title:"用固定示例盘看完整报告(不改动你已填的数据)"},"看示例"),p("button",{className:"mp-btn",onClick:bi,title:"时间仍为自动时,点它会取当下再起卦"},s==="tarot"?"抽牌":s==="bazi"||s==="ziwei"?"排盘":s==="hepan"?"合盘":s==="qimen"?"起局":$a.indexOf(s)>=0?"看结果":"起卦"))),p("div",{key:"hint",className:"mp-hint"},ln.hint),le.length?p("div",{key:"hist",className:"mp-hist"},p("div",{className:"mp-hist-h"},p("span",null,"最近排过"),p("button",{className:"mp-hist-clear",onClick:Hn},"清空")),p("div",{className:"mp-hist-list"},le.map((t,g)=>p("button",{key:g,className:"mp-hist-item",title:`${String(t.date||"")} ${t.hourUnknown?"时辰未知":String(t.time||"")}`,onClick:()=>_n(t)},p("b",null,(He.find(N=>N.k===t.kind)||{}).label||t.kind),p("span",null,t.label||"—"),p("i",null,`${String(t.date||"").slice(5)} ${t.hourUnknown?"时辰未知":String(t.time||"")}`))))):null,Ee==="cast"&&gi?p("div",{key:"auto",className:"mp-auto"},Ca.cast?`起卦时刻用的是你手动填的(${V});想跟随当下,把时间改回或清空即可。`:`起卦时刻已自动取本机时间(${V}),每次点起卦都会重新取当下;想固定时刻就在上面改。`):null,ut?p("div",{key:"err",className:"mp-err",role:"alert"},ut):null,oi?p("div",{key:"ntc",className:"mp-note",role:"status"},oi):null,sn?p("div",{key:"load",className:"mp-note",role:"status"},"正在加载本页需要的引擎…"):null,!b&&!ut?p("div",{key:"empty",className:"mp-empty"},p("b",null,s==="ziwei"||s==="bazi"?"填好出生信息,点「排盘」":s==="tarot"?"写下想问的事,点「抽牌」":s==="mbti"?"按 1–5 给题目打分,答满 12 题就能看结果":$a.indexOf(s)>=0?"填好参数,点「看结果」":"写下所问之事,点「起卦」"),s==="ziwei"||s==="bazi"?"出生日期、时刻与性别即可;出生地只影响真太阳时。":s==="mbti"?"4 题一页,答案只在本地参与计算,不会上传。":$a.indexOf(s)>=0?"按上面的选项填好参数即可;全部在本机计算,不上传。":"起卦时刻已自动取当下,也可以手动改。"):null,b?p("div",{key:"card",className:"mp-card mp-flat",role:"region","aria-label":"排盘结果","aria-live":"polite",onClick:zn,dangerouslySetInnerHTML:{__html:jn(b)+B.perfHTML(h)+B.revisionHTML(b.r.revision)+B.handleHTML(b.r.handle)+B.shadowHTML(b.r.shadow,b.shadowDiff)+B.traceHTML(b.r.trace,b.r.system,b.r.traceText)+B.resultWithInterpret(b.kind==="ziwei"?B.ziweiHTML(b.r):b.kind==="bazi"?B.baziHTML(b.r)+(b.trend?B.trendHTML(b.trend,{brief:!1}):""):b.kind==="meihua"?B.meihuaHTML(b.r):b.kind==="daliuren"?B.daliurenHTML(b.r):b.kind==="qimen"?B.qimenHTML(b.r)+B.qimenFactsHTML(b.r):b.kind==="hepan"?b.r.chart==="ziwei"?B.ziweiHepanHTML(b.r):B.hepanHTML(b.r):b.kind==="tarot"?B.tarotHTML(b.r):b.kind==="liuyao"?B.liuyaoHTML(b.r):b.kind==="chenggu"?B.chengguHTML(b.r):b.kind==="almanac"?B.almanacHTML(b.r):b.kind==="zeri"?B.zeriHTML(b.r):b.kind==="trend"?B.trendHTML(b.r):b.kind==="name"?B.nameHTML(b.r):b.kind==="mbti"?B.mbtiHTML(b.r):b.kind==="fengshui"?B.fengshuiHTML(b.r):B.quickHTML(b.r),b.it,{folded:hn()})+B.caliberHTML(b.caliber)}}):null,b?p("div",{key:"bar",className:"mp-bar"},p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px"},onClick:qn},pn||"复制文字结果"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:An,title:"导出盘面 + 解析(含一页读懂、三张表)为 Markdown"},"导出 .md"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:Tn,title:"生成 PNG 摘要卡(一页读懂 + 首张表),适合直接分享"},"存为摘要长图")):null,b?p("div",{key:"ask",className:"mp-askbox",style:{flexWrap:"wrap"}},p("input",{className:"mp-input",value:Ce,maxLength:120,placeholder:"追问:如 2027 年事业怎么样(回车提交)",onChange:t=>It(t.target.value),onKeyDown:t=>{t.key==="Enter"&&ki()}}),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px"},onClick:ki},"追问"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"5px 12px",marginLeft:8},onClick:Nn,title:"把这张盘的摘要和你的问题一起发进 DSH 对话窗,由对话里的模型接着答"},"问进对话"),W.ref?null:p("div",{key:"bridgediag",className:"mp-note",style:{marginTop:6,fontSize:11,flexBasis:"100%"}},Va()),aa?p("div",{key:"chatnote",className:"mp-note",style:{marginTop:6,fontSize:12,flexBasis:"100%"}},aa):null):null,b?p("div",{key:"bridge",className:"mp-bridge"},p("span",{className:"mp-bridge-lbl"},W.ref?"桥可用;也可以:":"桥未就绪,改走这几档:"),yi.map(([t,g,N])=>p("button",{key:t,type:"button",className:"mp-chip","data-bridge-copy":t,title:N,onClick:_=>wn(t,_.currentTarget)},g))):null,Gt?p("div",{key:"fx",className:"mp-fx",dangerouslySetInnerHTML:{__html:B.followupHTML(Gt)}}):null,b&&b.kind==="bazi"&&b.r.past?p("div",{key:"verify",className:"mp-verify"},p("div",{className:"mp-verify-h"},"验前事 · 过去几年的信号(只读,不改盘)"),b.r.past.rows.map(t=>p("div",{key:t.year,className:"mp-verify-row"},p("span",{className:"mp-verify-txt"},`${t.year} ${t.ganzhi} · ${t.theme}`),p("span",{className:"mp-verify-btns"},["yes","no","unsure"].map(g=>p("button",{key:g,className:"mp-chip"+(De[t.year]===g?" on":""),onClick:()=>rt(Object.assign({},De,{[t.year]:g}))},g==="yes"?"准":g==="no"?"不准":"不确定"))))),p("div",{className:"mp-verify-foot"},p("button",{className:"mp-btn ghost",style:ji,onClick:Ln},"算贴合度"),pt?p("span",{className:"mp-verify-fit"},`命中 ${pt.yes}/${pt.answered}(${pt.level}):${pt.advice}`):null)):null,b&&b.kind==="bazi"?p("div",{key:"rect",className:"mp-rect"},p("div",{className:"mp-verify-h"},"生时校正 · 用过去的事反推时辰"),qt.map((t,g)=>p("div",{key:g,className:"mp-rect-row"},p("input",{className:"mp-input",type:"number",min:1900,max:2100,value:t.year,onChange:N=>ia(qt.map((_,v)=>v===g?Object.assign({},_,{year:N.target.value}):_))}),p("select",{className:"mp-input",value:t.kind,onChange:N=>ia(qt.map((_,v)=>v===g?Object.assign({},_,{kind:N.target.value}):_))},[["career","事业变动"],["wealth","财运"],["love","感情"],["move","搬迁/出行"],["health","健康"],["other","其他"]].map(([N,_])=>p("option",{key:N,value:N},_))))),p("button",{className:"mp-btn ghost",style:ji,onClick:En},"计算候选时辰"),Ue?Ue.error?p("div",{className:"mp-rect-err"},Ue.error):p("div",{className:"mp-rect-out"},p("div",{className:"mp-verify-fit"},Ue.note),Ue.candidates.slice(0,6).map(t=>p("div",{key:t.hour,className:"mp-rect-cand"+(t===Ue.best?" best":"")},`${t.label} · 时柱 ${t.hourGanzhi} · 日柱 ${t.dayGanzhi} · 命中 ${t.hits}/${t.total}`))):null):null,!b&&!ut?p("div",{key:"ph",className:"mp-dim",style:{marginTop:24,fontSize:12}},"选择体系后点「排盘」。所有计算在本机完成,不上传任何数据。"):null,p("div",{key:"fb",className:"mp-fb"},p("div",{className:"mp-fb-h"},p("span",{className:"mp-fb-t"},"用得不对、读不懂、或算得跟别家不一样?"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"4px 10px"},onClick:zi,title:"生成一份含输入、版本、环境与结果摘要的报告,粘贴到 issue / 邮件 / 群聊即可"},X||"复制反馈报告"),p("button",{className:"mp-btn ghost",style:{fontSize:12,padding:"4px 10px",marginLeft:6},onClick:()=>Cn(),title:"在浏览器打开 GitHub issue(报告已复制到剪贴板,粘进去即可)"},"开 issue")),p("div",{className:"mp-fb-b"},"邮件 1129440028@qq.com · GitHub issues · 微信群 dsh-metaphysics",ce?p("span",{className:"mp-fb-note"}," "+ce):null))];return p("div",{className:"mp-wrap"},Gn)}function tn(s){try{if(typeof styles<"u"&&styles&&typeof styles.insert=="function")return styles.insert(s)}catch(n){console.error("[metaphysics] styles.insert 不可用,改用 DOM 注入",n)}try{const n=document.createElement("style");return n.setAttribute("data-plugin","@local/metaphysics"),n.textContent=s,document.head.appendChild(n),()=>n.remove()}catch(n){return console.error("[metaphysics] DOM 注入样式也失败",n),()=>{}}}let ti=!1;function ka(){try{const s=document.documentElement;if(!s||!document.body)return;const n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="position:absolute;left:-9999px;top:0;width:0;height:0;pointer-events:none;background:var(--dsw-alias-brand-primary)",document.body.appendChild(n);const q=getComputedStyle(n).backgroundColor;n.remove();const D=Ne&&typeof Ne.pickOnColor=="function"?Ne.pickOnColor(q):"";D&&s.style&&s.style.getPropertyValue("--mp-on-brand")!==D&&s.style.setProperty("--mp-on-brand",D)}catch{}}function an(){if(!ti){ti=!0,ka();try{const s=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)");s&&typeof s.addEventListener=="function"&&s.addEventListener("change",ka)}catch{}try{typeof MutationObserver=="function"&&document.documentElement&&new MutationObserver(ka).observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]})}catch{}}}function nn(s){try{const O=tn(Ii+(B&&B.CSS?B.CSS:""));typeof s.effect=="function"&&typeof O=="function"&&s.effect(()=>O)}catch(O){console.error("[metaphysics] 样式注入失败",O)}try{an()}catch(O){console.error("[metaphysics] 字色同步失败",O)}let n=null;try{n=s&&s.slots||(s&&typeof s.get=="function"?s.get("slots"):null)}catch(O){console.error("[metaphysics] 取 slots 服务失败",O)}if(!n||typeof n.register!="function"){console.error("[metaphysics] slots 服务不可用,面板未注册");return}try{W.injectType=typeof n.inject;const O=typeof n.spec=="function"?n.spec("conversation.input.right"):null;W.spec=O?O.kind+"/"+O.scope:"未声明"}catch(O){W.spec="取声明失败",Xa(O)}const q=O=>{if(typeof O=="function")return O;if(O&&typeof O=="object"){for(const he of["dispose","off","cancel","unregister"])if(typeof O[he]=="function")return()=>{try{O[he]()}catch{}}}return()=>{}},D=(O,he)=>{try{const xe=n.register(O,he);return W.regs+=1,W.seatOk[O.name]=!0,q(xe)}catch(xe){return Xa(xe),()=>{}}},V=(O,he)=>{const xe=()=>{const G=he();return W.contribution=(W.contribution?W.contribution+",":"")+(O+(typeof G=="function"?" 已挂上":" 未挂上")),G};try{typeof n.inject=="function"?n.inject(O,xe):xe()}catch(G){console.error("[metaphysics] 等待槽位失败:"+O,G);try{xe()}catch(Z){console.error("[metaphysics] 直接注册也失败:"+O,Z)}}};V("sidebar.panellist",()=>D({name:"sidebar.panellist",id:"metaphysics",order:20,label:()=>"命理 v"+(window.__MP_VER||"")},Yi)),V("main",()=>D({name:"main",key:"metaphysics"},O=>p(Ki,null,p(en,O))));const te=(O,he)=>{const xe=()=>{try{const Z=n.inject(O,he);return W.contribution=(W.contribution?W.contribution+",":"")+(O.replace("conversation.","")+(typeof Z=="function"?" 已挂上":" 未挂上")),Z}catch(Z){console.error("[metaphysics] 槽位注册失败:"+O,Z);try{return he()}catch(R){console.error("[metaphysics] 直接注册也失败:"+O,R);return}}};let G;try{typeof s.effect=="function"?G=s.effect(xe,"metaphysics: "+O):G=xe()}catch(Z){console.error("[metaphysics] effect 包裹失败:"+O,Z),G=xe()}typeof G=="function"&&W.seatDisposers.push(G)};te("conversation.input.right",()=>D({name:"conversation.input.right",id:"metaphysics-ask",order:40},Ja)),te("conversation.composer.dock",()=>D({name:"conversation.composer.dock",id:"metaphysics-dock",order:60},Qa));let ie=!1;const oe=()=>{W.ref||ie||(ie=!0,W.seatOk["conversation.input.right"]||D({name:"conversation.input.right",id:"metaphysics-ask",order:40},Ja),W.seatOk["conversation.composer.dock"]||D({name:"conversation.composer.dock",id:"metaphysics-dock",order:60},Qa))};let a=20;const fe=()=>!!(W.seatOk["conversation.input.right"]&&W.seatOk["conversation.composer.dock"]),ze=()=>{W.ref||a<=0||fe()||(a-=1,oe(),!fe()&&setTimeout(ze,700))};try{setTimeout(ze,700)}catch{}try{document.addEventListener("pointerdown",()=>{ie=!1,oe()},{once:!0,capture:!0})}catch{}}return{inject:["slots"],apply(s){try{nn(s)}catch(n){console.error("[metaphysics] apply 异常",n)}}}}});
|