dev-process-kit 0.3.0-beta.1 → 0.3.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boards.js +1 -1
- package/dist/chunks/{shared-CnPCm4bJ.js → shared-BLzPmv14.js} +1 -1
- package/dist/chunks/{shared-C-M2Nfmu.js → shared-BYcLqnFV.js} +3 -3
- package/dist/chunks/shared-BYr9ZouD.js +1864 -0
- package/dist/chunks/{shared-dnY35u9q.js → shared-BhUEVKpO.js} +34 -34
- package/dist/chunks/{shared-e9ia12Uz.js → shared-Bt5HGgX9.js} +17 -17
- package/dist/chunks/{shared-a9QCZpxj.js → shared-BzKZc8e7.js} +1 -1
- package/dist/chunks/{shared-Cas88qVh.js → shared-CJnwvCXE.js} +1 -1
- package/dist/chunks/{shared-BX1EnRfr.js → shared-CO-HhC8m.js} +1 -1
- package/dist/chunks/shared-CXefnQqJ.js +5222 -0
- package/dist/chunks/shared-D4PPk0Dk.js +1 -0
- package/dist/chunks/{shared-Cejw83eH.js → shared-D6X_HEJN.js} +1 -1
- package/dist/chunks/shared-D9js0mlL.js +6322 -0
- package/dist/chunks/{shared-df9XN7ns.js → shared-DEco37gW.js} +1 -1
- package/dist/chunks/shared-DIHtcDps.js +1 -0
- package/dist/chunks/shared-DXPlz1s4.js +767 -0
- package/dist/chunks/{shared-qk9TB_UM.js → shared-NkccEMPc.js} +1 -1
- package/dist/chunks/shared-naTB_LaU.js +3662 -0
- package/dist/components.js +1 -1
- package/dist/index.js +1 -1
- package/dist/views/delegation-poker.js +1 -1
- package/dist/views/plain.js +1 -1
- package/dist/views/prototype.js +1 -1
- package/dist/views/slides.js +1 -1
- package/dist/views/task-board.js +1 -1
- package/dist/views/usm.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/shared-CfVpKPRY.js +0 -1844
- package/dist/chunks/shared-D1iBuYZV.js +0 -6208
- package/dist/chunks/shared-D7VtCoY6.js +0 -3586
- package/dist/chunks/shared-DHVDag3x.js +0 -573
- package/dist/chunks/shared-DdpMqkAH.js +0 -4928
- package/dist/chunks/shared-EYOAbLSo.js +0 -1
- package/dist/chunks/shared-TrlnHjrJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah as T,al as R,b2 as Ps,H as Is,b3 as Xt,b4 as Os,b5 as Us,au as B,a9 as kt,aw as u,b6 as Yt,aa as w,aX as vt,a8 as Zt,aD as Jt,ac as b,aL as Fs,ad as dt,aO as Qt,az as st,aH as F,b7 as te,av as y,ax as $,a_ as xt,ay as E,aM as W,aB as at,aj as I,aC as ee,ab as V,aA as se,ag as yt,ar as ae,aY as Hs,aW as ne,b8 as _s,b9 as wt,ba as Bs,bb as ie,bc as ct,z as Ns,bd as re,aG as Ws,aZ as Gs,y as Ks,be as Vs,_ as Xs,$ as Ys}from"./shared-DdpMqkAH.js";import{o as N,r as Zs}from"./shared-TrlnHjrJ.js";import{e as Js}from"./shared-a9QCZpxj.js";import{a as oe,c as Qs}from"./shared-Cas88qVh.js";import{c as ta}from"./shared-qk9TB_UM.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-C-M2Nfmu.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-df9XN7ns.js";import{d as ya}from"./shared-CnPCm4bJ.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=qs(a),i=t.find(l=>l.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(l,d,o,g)=>{const p=o*a.scale,f=g*$a;if(p<=g){const S=ut(n,d,o,a.scale,g);return G(l,S-f,S+f)}return G(l,g-(d+o)*a.scale-f,-d*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,l="center")=>{const d=Math.abs(i)>Math.abs(n);if(d&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,l);return d&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:l=!0}=a;let d={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const g=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:m}=g();o=me(o,d,c,m,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:m}=g(),k=d.width/1.2||1,x=d.height/1.2||1,C=G(Math.min((c-24)/k,(m-40)/x),ht,1);o={scale:C,x:ut(i,d.x,d.width,C,c),y:ut(i,d.y,d.height,C,m)},p()},S=c=>{const{width:m,height:k}=g(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((m-24)/C,(k-40)/L),ht,pe)},o={...o,x:(m-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=g(),m=d.width/1.2||1,k=G((c-24)/m,ht,1);o={scale:k,x:(c-d.width*k)/2-d.x*k,y:16},p()},lt=c=>{const{width:m,height:k}=g(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(d.x,d.width,m,c?.x),y:x(d.y,d.height,k,c?.y)},p()},_=(c,m=g().width/2,k=g().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:m-(m-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const m=c.deltaMode===1?16:c.deltaMode===2?g().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();_(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=g(),C=Ca(o,d,k,x,c.deltaX*m,c.deltaY*m,i);C!==null&&(c.preventDefault(),o=C,p())},q=new Map;let A=null,P=!1;const U=()=>{const c=[...q.values()],m=c[0];if(!m)return null;const k=c[1];return k?{x:(m.x+k.x)/2,y:(m.y+k.y)/2,distance:Math.hypot(k.x-m.x,k.y-m.y)}:{...m,distance:0}},tt=c=>{q.size===0&&(P=!1);const m=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&m!==null||(q.set(c.pointerId,{x:c.clientX,y:c.clientY}),A=U(),m===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&m===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!q.has(c.pointerId)||A===null)return;q.set(c.pointerId,{x:c.clientX,y:c.clientY});const m=U();if(m===null)return;const k=m.x-A.x,x=m.y-A.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(m.distance-A.distance)>1)&&(P=!0),m.distance>0&&A.distance>0){const C=t.getBoundingClientRect();_(Math.pow(m.distance/A.distance,.45),A.x-C.left,A.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),A=m,t.classList.toggle("is-panning",P)},et=c=>{q.delete(c.pointerId),A=U(),!(q.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(P=!1))},_t=c=>{P&&(c.preventDefault(),c.stopPropagation()),et(c)},Bt=c=>{if(P){c.preventDefault(),c.stopPropagation(),P=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const m=30;if(c.key==="+"||c.key==="=")_(1.1);else if(c.key==="-")_(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?m:c.key==="ArrowRight"?-m:0),y:o.y+(c.key==="ArrowUp"?m:c.key==="ArrowDown"?-m:0)},p();else return;c.preventDefault()},Wt=c=>{const m=c.target instanceof HTMLElement?c.target:null;if(m===null||!c.composedPath().includes(e))return;const k=m.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",_t),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",Bt,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){d=he(c.width===0&&c.height===0?[]:[c]),l&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:_,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",_t),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",Bt,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Ta{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Aa=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,T`
|
|
1
|
+
import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah as T,al as R,b3 as Ps,H as Is,b4 as Xt,b5 as Os,b6 as Us,au as B,a9 as kt,aw as u,b7 as Yt,aa as w,aY as vt,a8 as Zt,aD as Jt,ac as b,aL as Fs,ad as dt,aO as Qt,az as st,aH as F,b8 as te,av as y,ax as $,a$ as xt,ay as E,aM as W,aB as at,aj as I,aC as ee,ab as V,aA as se,ag as yt,ar as ae,aZ as Hs,aX as ne,b9 as _s,aW as wt,ba as Bs,bb as ie,bc as ct,z as Ns,bd as re,aG as Ws,a_ as Gs,y as Ks,be as Vs,_ as Xs,$ as Ys}from"./shared-CXefnQqJ.js";import{o as N,r as Zs}from"./shared-D4PPk0Dk.js";import{e as Js}from"./shared-BzKZc8e7.js";import{a as oe,c as Qs}from"./shared-CJnwvCXE.js";import{c as ta}from"./shared-NkccEMPc.js";import{p as ea,i as sa,r as aa,c as na,a as le,b as de,d as ia,e as ra,f as oa,h as ce,g as la,j as $t,s as da,k as ca,l as pa,m as ha,n as ua,t as ma}from"./shared-BYcLqnFV.js";import{B as ga,t as fa,v as ba,i as ka,k as va,j as xa}from"./shared-DEco37gW.js";import{d as ya}from"./shared-BLzPmv14.js";class pt{#n;#t;#e=null;#s=null;#a=null;#i=null;#r=new Map;#o=null;constructor(t){this.#n=t,this.#t=new bt(t),t.addController(this)}get isOpen(){return this.#e!==null}open(t,e,s){this.#e=t,this.#a=e,this.#i=s??null,this.#o=null,this.#n.requestUpdate()}close(){this.#e=null,this.#a=null,this.#i=null,this.#n.requestUpdate()}hostDisconnected(){this.close()}sync(t){const e=this.#s!==this.#e;this.#s=this.#e,!(t===null||this.#a===null||this.#e===null)&&(this.#t.open(t,this.#a,{width:300,height:280},{placement:"right-start",trackTransform:!0}),e&&t.querySelector("textarea")?.focus({preventScroll:!0}))}render(t){const e=this.#e;if(e===null)return h;const s=ea(this.#r.get(e)??"",[],{...this.#i===null?{}:{label:this.#i},key:e,...this.#o===e&&t.errorMessage!==void 0?{error:t.errorMessage}:{}});return r`${sa(e,aa(na(t.locale),s,n=>this.#l(e,t.submit,n)))}`}#l(t,e,s){if(s.kind==="input"){this.#r=new Map(this.#r).set(t,s.body),this.#o=null,this.#n.requestUpdate();return}if(s.kind==="comment"){if(!e(t,s.body)){this.#o=t,this.#n.requestUpdate();return}const i=new Map(this.#r);i.delete(t),this.#r=i}this.#o=null,this.close()}}const Ct=(a,t,e,s)=>{if(a===null)return null;const n=qs(a),i=t.find(d=>d.value===n);return i===void 0?null:{id:"review-comment",entries:[{kind:"item",id:"review-comment",label:e.reviewComment,run:()=>s(n,i.label)}]}},ht=.08,pe=1.8,he=a=>{if(a.length===0)return{x:0,y:0,width:0,height:0};const t=Math.min(...a.map(i=>i.x)),e=Math.min(...a.map(i=>i.y)),s=Math.max(...a.map(i=>i.x+i.width))-t,n=Math.max(...a.map(i=>i.y+i.height))-e;return{x:t-s*.1,y:e-n*.1,width:s*1.2,height:n*1.2}},ue=(a,t)=>a+t/12,wa=(a,t)=>{if(a.length===0)return null;const e=Math.min(...a.map(n=>n.y)),s=a.filter(n=>n.y<e+t);return{x:Math.min(...s.map(n=>n.x)),y:e}},St=16,$a=.8,ut=(a,t,e,s,n)=>a==="start"?St-ue(t,e)*s:(n-e*s)/2-t*s,me=(a,t,e,s,n="center")=>{if(t.width===0||t.height===0)return{...a,x:0,y:0};const i=(d,l,o,m)=>{const p=o*a.scale,f=m*$a;if(p<=m){const S=ut(n,l,o,a.scale,m);return G(d,S-f,S+f)}return G(d,m-(l+o)*a.scale-f,-l*a.scale+f)};return{...a,x:i(a.x,t.x,t.width,e),y:i(a.y,t.y,t.height,s)}},Ca=(a,t,e,s,n,i,d="center")=>{const l=Math.abs(i)>Math.abs(n);if(l&&t.height*a.scale<=s)return null;const o=me({...a,x:a.x-n,y:a.y-i},t,e,s,d);return l&&o.y===a.y?null:o},Sa=a=>Math.exp(-a*.01),ge='button,[role="button"],a,input,textarea,select',Et=(a,t,e)=>{for(const s of a.composedPath()){if(s===t)return null;if(s instanceof Element&&s.matches(e))return s}return null},Ea=a=>{const{canvas:t,world:e,onClearSelection:s,onView:n,align:i="center",sizeWorld:d=!0}=a;let l={x:0,y:0,width:0,height:0},o={x:0,y:0,scale:1};const m=()=>({width:t.clientWidth||1e3,height:t.clientHeight||560}),p=()=>{const{width:c,height:g}=m();o=me(o,l,c,g,i),e.style.transform=`translate(${o.x}px, ${o.y}px) scale(${o.scale})`,e.style.setProperty("--dpk-zoom-inverse",String(1/o.scale)),e.style.setProperty("--dpk-zoom-scale",String(o.scale)),n?.(o)},f=()=>{const{width:c,height:g}=m(),k=l.width/1.2||1,x=l.height/1.2||1,C=G(Math.min((c-24)/k,(g-40)/x),ht,1);o={scale:C,x:ut(i,l.x,l.width,C,c),y:ut(i,l.y,l.height,C,g)},p()},S=c=>{const{width:g,height:k}=m(),x=he([c]),C=x.width/1.2||1,L=x.height/1.2||1;o={...o,scale:G(Math.min((g-24)/C,(k-40)/L),ht,pe)},o={...o,x:(g-x.width*o.scale)/2-x.x*o.scale,y:(k-x.height*o.scale)/2-x.y*o.scale},p()},O=()=>{const{width:c}=m(),g=l.width/1.2||1,k=G((c-24)/g,ht,1);o={scale:k,x:(c-l.width*k)/2-l.x*k,y:16},p()},lt=c=>{const{width:g,height:k}=m(),x=(C,L,Kt,Vt)=>Vt!==void 0?St-Vt:L<=Kt?ut(i,C,L,1,Kt):St-ue(C,L);o={scale:1,x:x(l.x,l.width,g,c?.x),y:x(l.y,l.height,k,c?.y)},p()},_=(c,g=m().width/2,k=m().height/2)=>{const x=o.scale,C=G(x*c,ht,pe);C!==x&&(o={scale:C,x:g-(g-o.x)*C/x,y:k-(k-o.y)*C/x},p())},Q=c=>{if(Et(c,t,".diagram-zoom")!==null)return;const g=c.deltaMode===1?16:c.deltaMode===2?m().height:1;if(c.ctrlKey||c.metaKey){c.preventDefault();const L=t.getBoundingClientRect();_(Sa(c.deltaY),c.clientX-L.left,c.clientY-L.top);return}const{width:k,height:x}=m(),C=Ca(o,l,k,x,c.deltaX*g,c.deltaY*g,i);C!==null&&(c.preventDefault(),o=C,p())},q=new Map;let A=null,P=!1;const U=()=>{const c=[...q.values()],g=c[0];if(!g)return null;const k=c[1];return k?{x:(g.x+k.x)/2,y:(g.y+k.y)/2,distance:Math.hypot(k.x-g.x,k.y-g.y)}:{...g,distance:0}},tt=c=>{q.size===0&&(P=!1);const g=Et(c,t,ge);c.button!==0||c.pointerType!=="touch"&&g!==null||(q.set(c.pointerId,{x:c.clientX,y:c.clientY}),A=U(),g===null&&t.setPointerCapture(c.pointerId),c.pointerType!=="touch"&&g===null&&(c.preventDefault(),t.focus({preventScroll:!0})))},Ht=c=>{if(!q.has(c.pointerId)||A===null)return;q.set(c.pointerId,{x:c.clientX,y:c.clientY});const g=U();if(g===null)return;const k=g.x-A.x,x=g.y-A.y;if((Math.abs(k)+Math.abs(x)>1||Math.abs(g.distance-A.distance)>1)&&(P=!0),g.distance>0&&A.distance>0){const C=t.getBoundingClientRect();_(Math.pow(g.distance/A.distance,.45),A.x-C.left,A.y-C.top)}o={...o,x:o.x+k,y:o.y+x},p(),A=g,t.classList.toggle("is-panning",P)},et=c=>{q.delete(c.pointerId),A=U(),!(q.size>0)&&(t.classList.remove("is-panning"),c.type==="pointercancel"&&(P=!1))},_t=c=>{P&&(c.preventDefault(),c.stopPropagation()),et(c)},Bt=c=>{if(P){c.preventDefault(),c.stopPropagation(),P=!1;return}!(c.target instanceof Element)||Et(c,t,ge)!==null||s()},Nt=c=>{if(c.target!==t)return;const g=30;if(c.key==="+"||c.key==="=")_(1.1);else if(c.key==="-")_(1/1.1);else if(c.key==="0")f();else if(c.key==="Escape"){if(s()===!1)return}else if(c.key==="ArrowLeft"||c.key==="ArrowRight"||c.key==="ArrowUp"||c.key==="ArrowDown")o={...o,x:o.x+(c.key==="ArrowLeft"?g:c.key==="ArrowRight"?-g:0),y:o.y+(c.key==="ArrowUp"?g:c.key==="ArrowDown"?-g:0)},p();else return;c.preventDefault()},Wt=c=>{const g=c.target instanceof HTMLElement?c.target:null;if(g===null||!c.composedPath().includes(e))return;const k=g.getBoundingClientRect(),x=t.getBoundingClientRect();let C=0,L=0;k.left<x.left+12?C=x.left+12-k.left:k.right>x.right-12&&(C=x.right-12-k.right),k.top<x.top+12?L=x.top+12-k.top:k.bottom>x.bottom-40&&(L=x.bottom-40-k.bottom),!(C===0&&L===0)&&(o={...o,x:o.x+C,y:o.y+L},p())};t.addEventListener("wheel",Q,{passive:!1}),t.addEventListener("pointerdown",tt),t.addEventListener("pointermove",Ht),t.addEventListener("pointerup",_t),t.addEventListener("pointercancel",et),t.addEventListener("lostpointercapture",et),t.addEventListener("click",Bt,!0),t.addEventListener("keydown",Nt),t.addEventListener("focusin",Wt);const Gt=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>p());return Gt?.observe(t),{setContent(c){l=he(c.width===0&&c.height===0?[]:[c]),d&&(e.style.width=`${c.width}px`,e.style.height=`${c.height}px`),p()},apply:p,fit:f,fitTo:S,fitWidth:O,reset:lt,zoom:_,view:()=>({...o}),destroy(){Gt?.disconnect(),t.removeEventListener("wheel",Q),t.removeEventListener("pointerdown",tt),t.removeEventListener("pointermove",Ht),t.removeEventListener("pointerup",_t),t.removeEventListener("pointercancel",et),t.removeEventListener("lostpointercapture",et),t.removeEventListener("click",Bt,!0),t.removeEventListener("keydown",Nt),t.removeEventListener("focusin",Wt)}}},za=["fit","fit-width","actual","none"];class Ta{#n;#t=null;#e=null;#s=!1;constructor(t,e){this.#n=e,t.addController(this)}hostDisconnected(){this.detach()}get attached(){return this.#t!==null}get view(){return this.#t?.view()??{x:0,y:0,scale:1}}attach(){this.detach();const t=this.#n.elements();if(t===null)return;const{canvas:e,world:s}=t;this.#t=Ea({canvas:e,world:s,align:this.#n.align(),sizeWorld:!1,onClearSelection:()=>this.#n.onDismiss(),onView:n=>this.#n.onView(n)}),this.#e=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>this.sync()),this.#e?.observe(s),this.sync()}detach(){this.#t?.destroy(),this.#t=null,this.#e?.disconnect(),this.#e=null}sync(){const t=this.#t,e=this.#n.elements()?.world;if(t===null||e===void 0)return;const s=this.#n.contentSize();e.style.width=s?`${s.width}px`:"",e.style.height=s?`${s.height}px`:"";const n=s?.width??e.offsetWidth,i=s?.height??e.offsetHeight;t.setContent({x:0,y:0,width:n,height:i}),!this.#s&&n>0&&i>0&&this.open()}open(){const t=this.#t;if(t===null)return;this.#s=!0;const e=this.#n.initial(),s=za.includes(e)?e:"fit";s==="fit"?t.fit():s==="fit-width"?t.fitWidth():s==="actual"&&t.reset()}fit(){this.#t?.fit()}fitWidth(){this.#t?.fitWidth()}fitTo(t){this.#t?.fitTo(t)}reset(t){this.#t?.reset(t)}zoom(t){this.#t?.zoom(t)}apply(){this.#t?.apply()}}const Aa=(a,t,e)=>a.some(s=>Math.abs(t)>Math.abs(e)?s.overflowX!=="auto"&&s.overflowX!=="scroll"||s.scrollWidth<=s.clientWidth?!1:t>0?s.scrollLeft+s.clientWidth<s.scrollWidth-1:t<0&&s.scrollLeft>0:s.overflowY!=="auto"&&s.overflowY!=="scroll"||s.scrollHeight<=s.clientHeight?!1:e>0?s.scrollTop+s.clientHeight<s.scrollHeight-1:e<0&&s.scrollTop>0),fe=160,zt=(a,t,e=fe)=>Math.max(e,Math.round(a+t)),Ma=(a,t,e,s=fe)=>{const n=e?96:24;return t==="ArrowDown"?zt(a,n,s):t==="ArrowUp"?zt(a,-n,s):null},be={kind:"idle"};class La{constructor(t,e){this.#e=null,this.#s=be,this.handlers={pointerdown:s=>{if(s.button!==0)return;s.preventDefault();const n=s.currentTarget;n instanceof Element&&n.setPointerCapture(s.pointerId),this.#s={kind:"dragging",pointerId:s.pointerId,startY:s.clientY,startHeight:this.#t()},this.#n.requestUpdate()},pointermove:s=>{const n=this.#s;n.kind!=="dragging"||n.pointerId!==s.pointerId||this.#a(zt(n.startHeight,s.clientY-n.startY))},pointerup:s=>this.#i(s),pointercancel:s=>this.#i(s),keydown:s=>{const n=Ma(this.#e??this.#t(),s.key,s.shiftKey);n!==null&&(s.preventDefault(),this.#a(n))},dblclick:()=>this.#a(null)},this.#n=t,this.#t=e,t.addController(this)}#n;#t;#e;#s;hostConnected(){}get height(){return this.#e}get dragging(){return this.#s.kind==="dragging"}#a(t){t!==this.#e&&(this.#e=t,this.#n.requestUpdate())}#i(t){const e=this.#s;e.kind!=="dragging"||e.pointerId!==t.pointerId||(this.#s=be,this.#n.requestUpdate())}}const Da=D({en:{maximize:"Maximize",restore:"Restore size",controls:"View controls",zoomOut:"Zoom out",fit:"Fit to view",zoomIn:"Zoom in",canvas:"Canvas. Arrow keys pan, plus and minus zoom, 0 fits the view.",resize:"Resize the panel",resizeHint:"Drag or use the up and down arrows to resize. Double-click restores the height."},ja:{maximize:"\u6700\u5927\u5316",restore:"\u5143\u306E\u30B5\u30A4\u30BA\u306B\u623B\u3059",controls:"\u8868\u793A\u306E\u64CD\u4F5C",zoomOut:"\u7E2E\u5C0F",fit:"\u5168\u4F53\u3092\u8868\u793A",zoomIn:"\u62E1\u5927",canvas:"\u30AD\u30E3\u30F3\u30D0\u30B9\u3002\u77E2\u5370\u30AD\u30FC\u3067\u30D1\u30F3\u3001\u30D7\u30E9\u30B9\u30FB\u30DE\u30A4\u30CA\u30B9\u3067\u30BA\u30FC\u30E0\u30010\u3067\u5168\u4F53\u8868\u793A\u3002",resize:"\u30D1\u30CD\u30EB\u306E\u9AD8\u3055\u3092\u5909\u3048\u308B",resizeHint:"\u30C9\u30E9\u30C3\u30B0\u3001\u307E\u305F\u306F\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9AD8\u3055\u3092\u5909\u3048\u308B\u3002\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5143\u306E\u9AD8\u3055\u306B\u623B\u3059\u3002"}});class ke extends z{static{this.styles=[M,K,T`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
color: var(--dpk-ink);
|
|
@@ -444,7 +444,7 @@ import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah
|
|
|
444
444
|
@dblclick=${e.dblclick}
|
|
445
445
|
>
|
|
446
446
|
${Us()}
|
|
447
|
-
</div>`}#u=t=>{if(!(t.target instanceof HTMLSlotElement))return;t.target.assignedElements({flatten:!0}).length>0!==this.#a&&this.requestUpdate()};#c(t){t!==this.maximized&&(this.maximized=t,this.dispatchEvent(new CustomEvent("dpk-maximize-change",{detail:{maximized:t},bubbles:!0,composed:!0})))}#m(){const t=this.renderRoot.querySelector(".panel");if(!(!this.maximized||!t||typeof t.showPopover!="function")&&!t.matches(":popover-open"))try{t.showPopover()}catch{}}#g=t=>{if(!this.maximized||t.defaultPrevented)return;const e=t.composedPath(),s=e.slice(0,Math.max(0,e.indexOf(this))).flatMap(n=>{if(!(n instanceof Element))return[];const{overflowX:i,overflowY:
|
|
447
|
+
</div>`}#u=t=>{if(!(t.target instanceof HTMLSlotElement))return;t.target.assignedElements({flatten:!0}).length>0!==this.#a&&this.requestUpdate()};#c(t){t!==this.maximized&&(this.maximized=t,this.dispatchEvent(new CustomEvent("dpk-maximize-change",{detail:{maximized:t},bubbles:!0,composed:!0})))}#m(){const t=this.renderRoot.querySelector(".panel");if(!(!this.maximized||!t||typeof t.showPopover!="function")&&!t.matches(":popover-open"))try{t.showPopover()}catch{}}#g=t=>{if(!this.maximized||t.defaultPrevented)return;const e=t.composedPath(),s=e.slice(0,Math.max(0,e.indexOf(this))).flatMap(n=>{if(!(n instanceof Element))return[];const{overflowX:i,overflowY:d}=getComputedStyle(n);return[{overflowX:i,scrollLeft:n.scrollLeft,scrollWidth:n.scrollWidth,clientWidth:n.clientWidth,overflowY:d,scrollTop:n.scrollTop,scrollHeight:n.scrollHeight,clientHeight:n.clientHeight}]});Aa(s,t.deltaX,t.deltaY)||t.preventDefault()};#v=t=>{!this.maximized||t.key!=="Escape"||t.defaultPrevented||(t.preventDefault(),this.#c(!1))}}const Ra=a=>`${Math.round(a.scale*100)}%`,ve=()=>{customElements.get("dpk-dialog-panel")||customElements.define("dpk-dialog-panel",ke)},ja=(a,t)=>a.active.includes(t)?{...a,active:a.active.filter(e=>e!==t)}:a.match==="single"?{...a,active:[t]}:{...a,active:[...a.active,t]},qa=(a,t)=>({match:t,active:t==="single"&&a.active.length>1?a.active.slice(-1):a.active}),Pa=a=>({...a,active:[]}),Ia=a=>{const t=new Map;for(const e of a)for(const s of new Set(e))t.set(s,(t.get(s)??0)+1);return[...t].map(([e,s])=>({tag:e,count:s}))},Oa={nodes:new Map,edges:new Set},xe=(a,t,e,s)=>{const n=new Map,i=new Set,d=[{id:t,depth:0}],l=new Set([t]);for(const o of d)if(!(!s&&o.depth>=1))for(const m of a){const p=e==="outgoing"?m.from:m.to,f=e==="outgoing"?m.to:m.from;p===o.id&&(i.add(m.id),!l.has(f)&&(l.add(f),n.set(f,o.depth+1),d.push({id:f,depth:o.depth+1})))}return{nodes:n,edges:i}},Ua=(a,t)=>{const e=new Map(a.map(i=>[i,xe(t,i,"outgoing",!0).nodes])),s=new Set,n=[];for(const i of a){if(s.has(i))continue;const d=a.filter(l=>l===i||e.get(i)?.has(l)===!0&&e.get(l)?.has(i)===!0);for(const l of d)s.add(l);(d.length>1||t.some(l=>l.from===i&&l.to===i))&&n.push(d)}return n},Fa=a=>new Map(a.flatMap((t,e)=>t.map(s=>[s,e]))),Ha=(a,t)=>t.get(a.from)===t.get(a.to)&&t.has(a.from),_a=(a,t,e,s)=>{const n=t!==null&&t.kind===e&&t.id===a,i=e==="node"?s.nodes.has(a):s.edges.has(a),d=e==="node"?s.nodes.get(a)??null:null;return{selected:n,related:i&&!n,dimmed:t!==null&&!n&&!i,depth:d}},Ba=(...a)=>a.filter(t=>typeof t=="string"&&t!=="").join(" "),Na=a=>{const t=a[0]??{x:0,y:0},e=a.at(-1)??t;if(a.length<=2)return{x:(t.x+e.x)/2,y:(t.y+e.y)/2};if(a.length===4){const l=a[1]??t,o=a[2]??e;return{x:(l.x+o.x)/2,y:(l.y+o.y)/2}}let s=0,n=-1;for(let l=0;l+1<a.length;l++){const o=a[l],m=a[l+1],p=Math.abs(m.x-o.x)+Math.abs(m.y-o.y);p>n&&(n=p,s=l)}const i=a[s]??t,d=a[s+1]??e;return{x:(i.x+d.x)/2,y:(i.y+d.y)/2}},Wa=D({en:{tagFilter:"Filter by tag",tagMatch:"Tag matching",clearTags:"Clear"},ja:{tagFilter:"\u30BF\u30B0\u306E\u7D5E\u308A\u8FBC\u307F",tagMatch:"\u30BF\u30B0\u306E\u4E00\u81F4\u6761\u4EF6",clearTags:"\u89E3\u9664"}}),Ga=["single","all","any"],ye=a=>a.startsWith(ga),Ka=a=>{const t=new Set,e=a.flatMap(s=>{const n=typeof s=="string"?{tag:s,count:null}:{tag:s.tag,count:s.count??null};return n.tag===""||t.has(n.tag)?[]:(t.add(n.tag),[n])});return[...e.filter(s=>ye(s.tag)),...e.filter(s=>!ye(s.tag))]},Va=Jt([b(),kt({tag:b(),count:Fs(dt())})]),Xa=kt({tags:w(vt()),active:u(Yt(Qt(w(vt())),null)),match:u(Yt(Qt(st(Ga)),null))}),we=a=>{const t=B(Xa,Array.isArray(a)?{tags:a}:a),e=t.tags.flatMap(n=>{const i=Zt(Va,n);return i.success?[i.output]:[]}),s=t.active?.filter(n=>typeof n=="string")??null;return{tags:e,active:s,match:t.match??null}},Ya=[["single","Single"],["all","AND"],["any","OR"]];class $e extends z{static{this.styles=[M,T`
|
|
448
448
|
:host {
|
|
449
449
|
display: block;
|
|
450
450
|
flex-shrink: 0;
|
|
@@ -594,7 +594,7 @@ import{aE as bt,ai as h,as as r,S as qs,aQ as G,a5 as D,ak as z,X as M,j as K,ah
|
|
|
594
594
|
</button>`:h}
|
|
595
595
|
</div>
|
|
596
596
|
`}get#e(){return Wa(this.#n.locale)}get#s(){return{active:this.active,match:this.match}}#a(t){this.active=t.active,this.match=t.match,this.dispatchEvent(new CustomEvent("dpk-tag-filter-change",{detail:{active:t.active,match:t.match},bubbles:!0,composed:!0}))}}const Ce=()=>{customElements.get("dpk-tag-filter")||customElements.define("dpk-tag-filter",$e)},Se=Symbol.for("dev-process-kit:atom-styles"),Ee=()=>{if(typeof document>"u"||Reflect.get(document,Se)===!0)return;Reflect.set(document,Se,!0),Js();const a=[te,oe].flatMap(e=>e.styleSheet?[e.styleSheet]:[]);if(a.length===2){document.adoptedStyleSheets=[...document.adoptedStyleSheets,...a];return}const t=document.createElement("style");t.dataset.dpkAtoms="",t.textContent=`${te.cssText}
|
|
597
|
-
${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No data to plot",invalid:a=>`Invalid chart data: ${a}`},ja:{aria:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",empty:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",invalid:a=>`\u30B0\u30E9\u30D5\u306E\u30C7\u30FC\u30BF\u304C\u4E0D\u6B63\u3067\u3059: ${a}`}}),Tt=["blue","green","amber","violet","accent","ink-faint"],ze=y({x:$(b(),E(1)),y:$(dt(),xt())}),Ja=y({id:W,label:$(b(),E(1)),points:w(ze),tone:u(st(Tt),"blue"),area:u(at(),!1)}),Qa=y({id:W,label:$(b(),E(1)),points:w(ze),tone:u(st(Tt),"ink-faint"),dashed:u(at(),!0)}),tn=y({x:$(b(),E(1)),label:$(b(),E(1)),tone:u(st(Tt),"accent")}),Te=y({label:u(b()),min:u($(dt(),xt())),max:u($(dt(),xt()))}),en=y({title:u(b(),""),caption:u(b(),""),series:u(w(Ja),[]),guides:u(w(Qa),[]),marks:u(w(tn),[]),xAxis:u(Te,{}),yAxis:u(Te,{})}),At=(a,t)=>{const e=new Set;for(const s of a){if(e.has(s))throw new Error(`duplicate ${t}: ${s}`);e.add(s)}},Ae=(a,t)=>{At(a.map(e=>e.x),`x in "${t}"`)},Me=a=>{const t=B(en,a);At(t.series.map(e=>e.id),"series id"),At(t.guides.map(e=>e.id),"guide id");for(const e of t.series)Ae(e.points,e.label);for(const e of t.guides)Ae(e.points,e.label);if(t.yAxis.min!==void 0&&t.yAxis.max!==void 0&&t.yAxis.min>=t.yAxis.max)throw new Error("yAxis.min must be less than yAxis.max");return t},X={top:22,right:18,bottom:38,left:52},Mt=6,sn=a=>{const t=[],e=new Set;for(const s of[...a.series,...a.guides])for(const n of s.points)e.has(n.x)||(e.add(n.x),t.push(n.x));return t},an=a=>{const t=[...a.series,...a.guides].flatMap(
|
|
597
|
+
${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No data to plot",invalid:a=>`Invalid chart data: ${a}`},ja:{aria:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",empty:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",invalid:a=>`\u30B0\u30E9\u30D5\u306E\u30C7\u30FC\u30BF\u304C\u4E0D\u6B63\u3067\u3059: ${a}`}}),Tt=["blue","green","amber","violet","accent","ink-faint"],ze=y({x:$(b(),E(1)),y:$(dt(),xt())}),Ja=y({id:W,label:$(b(),E(1)),points:w(ze),tone:u(st(Tt),"blue"),area:u(at(),!1)}),Qa=y({id:W,label:$(b(),E(1)),points:w(ze),tone:u(st(Tt),"ink-faint"),dashed:u(at(),!0)}),tn=y({x:$(b(),E(1)),label:$(b(),E(1)),tone:u(st(Tt),"accent")}),Te=y({label:u(b()),min:u($(dt(),xt())),max:u($(dt(),xt()))}),en=y({title:u(b(),""),caption:u(b(),""),series:u(w(Ja),[]),guides:u(w(Qa),[]),marks:u(w(tn),[]),xAxis:u(Te,{}),yAxis:u(Te,{})}),At=(a,t)=>{const e=new Set;for(const s of a){if(e.has(s))throw new Error(`duplicate ${t}: ${s}`);e.add(s)}},Ae=(a,t)=>{At(a.map(e=>e.x),`x in "${t}"`)},Me=a=>{const t=B(en,a);At(t.series.map(e=>e.id),"series id"),At(t.guides.map(e=>e.id),"guide id");for(const e of t.series)Ae(e.points,e.label);for(const e of t.guides)Ae(e.points,e.label);if(t.yAxis.min!==void 0&&t.yAxis.max!==void 0&&t.yAxis.min>=t.yAxis.max)throw new Error("yAxis.min must be less than yAxis.max");return t},X={top:22,right:18,bottom:38,left:52},Mt=6,sn=a=>{const t=[],e=new Set;for(const s of[...a.series,...a.guides])for(const n of s.points)e.has(n.x)||(e.add(n.x),t.push(n.x));return t},an=a=>{const t=[...a.series,...a.guides].flatMap(d=>d.points.map(l=>l.y));if(t.length===0)return null;const e=Math.min(...t),s=Math.max(...t),n=a.yAxis.min??Math.min(0,e);let i=a.yAxis.max??s;if(i<=n&&(i=n+1),a.yAxis.max===void 0){const d=i-n;i+=d*.08}return{min:n,max:i}},Lt=a=>a.length===0?"":a.map((t,e)=>`${e===0?"M":"L"}${Y(t.x)} ${Y(t.y)}`).join(" "),nn=(a,t)=>a.length===0?null:`${Lt(a)} L${Y(a.at(-1)?.x??0)} ${Y(t)} L${Y(a[0]?.x??0)} ${Y(t)} Z`,Y=a=>Math.round(a*100)/100,Le=a=>Number.isInteger(a)?String(a):String(Math.round(a*10)/10),rn=(a,t)=>{const e=a/Math.max(1,t),s=10**Math.floor(Math.log10(e)),n=e/s;return(n<=1?1:n<=2?2:n<=5?5:10)*s},on=(a,t,e)=>{const s=rn(t-a,4),n=Math.ceil(a/s)*s,i=[];for(let l=n;l<=t+s/1e3;l+=s)i.push({y:e(l),label:Le(l)});const d=e(a);return i.some(l=>Math.abs(l.y-d)<.01)||i.push({y:d,label:Le(a)}),i},ln=(a,t)=>{if(a.length===0)return[];if(a.length<=Mt)return a.map((s,n)=>({x:t(n),label:s}));const e=Array.from({length:Mt},(s,n)=>Math.round(n*(a.length-1)/(Mt-1)));return[...new Set(e)].map(s=>({x:t(s),label:a[s]??""}))},dn=(a,t=720,e=280)=>{const s=sn(a),n=an(a);if(s.length===0||n===null)return null;const i={left:X.left,top:X.top,width:t-X.left-X.right,height:e-X.top-X.bottom},d=new Map(s.map((f,S)=>[f,S])),l=f=>s.length===1?i.left+i.width/2:i.left+f/(s.length-1)*i.width,o=f=>i.top+(1-(f-n.min)/(n.max-n.min))*i.height,m=f=>f.flatMap(S=>{const O=d.get(S.x);return O===void 0?[]:[{x:l(O),y:o(S.y)}]}).sort((S,O)=>S.x-O.x),p=i.top+i.height;return{width:t,height:e,plot:i,series:a.series.map(f=>{const S=m(f.points);return{...f,nodes:S,path:Lt(S),areaPath:f.area?nn(S,p):null}}),guides:a.guides.map(f=>({...f,path:Lt(m(f.points))})),marks:a.marks.flatMap(f=>{const S=d.get(f.x);return S===void 0?[]:[{...f,x:l(S)}]}),xTicks:ln(s,l),yTicks:on(n.min,n.max,o)}},cn=T`
|
|
598
598
|
:host {
|
|
599
599
|
display: block;
|
|
600
600
|
min-width: 0;
|
|
@@ -622,22 +622,22 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
622
622
|
</header>`}
|
|
623
623
|
<div class="dpk-chart-plot">${this.#i(e,s,n)}</div>
|
|
624
624
|
${this.#d(e)}
|
|
625
|
-
</section>`}#a(t){return r`<section class="dpk-chart" role="status">${t}</section>`}#i(t,e,s){const{plot:n,width:i,height:
|
|
625
|
+
</section>`}#a(t){return r`<section class="dpk-chart" role="status">${t}</section>`}#i(t,e,s){const{plot:n,width:i,height:d}=e,l=n.top+n.height;return r`<svg viewBox="0 0 ${i} ${d}" role="img" aria-label=${s}>
|
|
626
626
|
<title>${s}</title>
|
|
627
627
|
<g class="dpk-chart-grid">
|
|
628
628
|
${e.yTicks.map(o=>I`<line x1=${n.left} x2=${n.left+n.width} y1=${o.y} y2=${o.y}></line>`)}
|
|
629
629
|
</g>
|
|
630
630
|
<g class="dpk-chart-axis">
|
|
631
|
-
<line x1=${n.left} x2=${n.left} y1=${n.top} y2=${
|
|
632
|
-
<line x1=${n.left} x2=${n.left+n.width} y1=${
|
|
631
|
+
<line x1=${n.left} x2=${n.left} y1=${n.top} y2=${l}></line>
|
|
632
|
+
<line x1=${n.left} x2=${n.left+n.width} y1=${l} y2=${l}></line>
|
|
633
633
|
</g>
|
|
634
634
|
${e.yTicks.map(o=>I`<text class="dpk-chart-tick" x=${n.left-8} y=${o.y+3} text-anchor="end">${o.label}</text>`)}
|
|
635
|
-
${e.xTicks.map(o=>I`<text class="dpk-chart-tick" x=${o.x} y=${
|
|
636
|
-
${t.xAxis.label===void 0?h:I`<text class="axis-label" x=${n.left+n.width/2} y=${
|
|
635
|
+
${e.xTicks.map(o=>I`<text class="dpk-chart-tick" x=${o.x} y=${l+16} text-anchor="middle">${o.label}</text>`)}
|
|
636
|
+
${t.xAxis.label===void 0?h:I`<text class="axis-label" x=${n.left+n.width/2} y=${d-3} text-anchor="middle">${t.xAxis.label}</text>`}
|
|
637
637
|
${t.yAxis.label===void 0?h:I`<text class="axis-label" x=${12} y=${n.top+n.height/2} text-anchor="middle" transform="rotate(-90 12 ${n.top+n.height/2})">${t.yAxis.label}</text>`}
|
|
638
638
|
${e.guides.map(o=>this.#o(o))}
|
|
639
639
|
${e.series.map(o=>this.#r(o))}
|
|
640
|
-
${e.marks.map(o=>this.#l(o,n.top,
|
|
640
|
+
${e.marks.map(o=>this.#l(o,n.top,l))}
|
|
641
641
|
</svg>`}#r(t){return t.path===""?h:I`${t.areaPath===null?h:I`<path class="dpk-chart-area" d=${t.areaPath} style=${H(t.tone)}></path>`}
|
|
642
642
|
<path class="dpk-chart-line" d=${t.path} style=${H(t.tone)}></path>
|
|
643
643
|
${t.nodes.map(e=>I`<circle
|
|
@@ -667,7 +667,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
667
667
|
>`)}
|
|
668
668
|
${t.guides.map(e=>r`<span class="dpk-chart-key" data-variant="dashed" style=${H(e.tone)}>${e.label}</span>`)}
|
|
669
669
|
${t.marks.map(e=>r`<span class="dpk-chart-key" data-variant="mark" style=${H(e.tone)}>${e.label}</span>`)}
|
|
670
|
-
</div>`}}const Re=()=>{customElements.get("dpk-line-chart")||customElements.define("dpk-line-chart",De)},pn=D({en:{heading:"Formal spec",empty:"No claims.",dataError:"Could not load the specification data.",claims:a=>`${a} ${a===1?"claim":"claims"}`,subjects:"For",premises:"Given",conclusions:"Then",noPremises:"None \u2014 holds unconditionally",showDetails:"Show the details of this claim",hideDetails:"Hide the details of this claim",examples:"Examples",notClaimed:"Not claimed",usesTerms:"Terms",source:"Source",proved:"Proved",conditional:"Proved under assumptions",bounded:"Checked within bounds",incomplete:"Incomplete",provedDetail:"Machine-checked to hold in every case.",conditionalDetail:"Holds in every case, provided the assumptions are true.",boundedDetail:"Every case within the bound was checked; nothing outside it was.",incompleteDetail:"The proof is not finished. Nothing here is guaranteed yet.",planned:"Planned",plannedDetail:"Not proved yet: a property proposed to be proved, for agreement before the work starts.",target:"About",noClaims:"No claims yet.",assumptions:"Assumes",bound:"Checked within",gaps:"Unfinished",commentOn:a=>`Comment on ${a}`,sendFailed:"Could not send. Place this inside a dpk-view-* element."},ja:{heading:"\u5F62\u5F0F\u4ED5\u69D8",empty:"\u4E3B\u5F35\u304C\u3042\u308A\u307E\u305B\u3093\u3002",dataError:"\u4ED5\u69D8\u306E\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",claims:a=>`${a} \u4EF6\u306E\u4E3B\u5F35`,subjects:"\u5165\u529B\u30FB\u72B6\u6CC1",premises:"\u524D\u63D0",conclusions:"\u7D50\u8AD6",noPremises:"\u306A\u3057 \u2014 \u7121\u6761\u4EF6\u306B\u6210\u308A\u7ACB\u3064",showDetails:"\u3053\u306E\u4E3B\u5F35\u306E\u8A73\u7D30\u3092\u958B\u304F",hideDetails:"\u3053\u306E\u4E3B\u5F35\u306E\u8A73\u7D30\u3092\u9589\u3058\u308B",examples:"\u5177\u4F53\u4F8B",notClaimed:"\u4E3B\u5F35\u3057\u3066\u3044\u306A\u3044\u3053\u3068",usesTerms:"\u4F7F\u3046\u7528\u8A9E",source:"\u51FA\u5178",proved:"\u8A3C\u660E\u6E08\u307F",conditional:"\u4EEE\u5B9A\u3064\u304D\u3067\u8A3C\u660E\u6E08\u307F",bounded:"\u7BC4\u56F2\u3092\u9650\u3063\u3066\u78BA\u8A8D",incomplete:"\u672A\u5B8C\u6210",provedDetail:"\u3059\u3079\u3066\u306E\u5834\u5408\u306B\u6210\u308A\u7ACB\u3064\u3053\u3068\u304C\u6A5F\u68B0\u7684\u306B\u78BA\u304B\u3081\u3089\u308C\u3066\u3044\u307E\u3059\u3002",conditionalDetail:"\u4EEE\u5B9A\u304C\u6B63\u3057\u3051\u308C\u3070\u3001\u3059\u3079\u3066\u306E\u5834\u5408\u306B\u6210\u308A\u7ACB\u3061\u307E\u3059\u3002",boundedDetail:"\u7BC4\u56F2\u5185\u306F\u3059\u3079\u3066\u306E\u5834\u5408\u3092\u78BA\u304B\u3081\u307E\u3057\u305F\u3002\u7BC4\u56F2\u306E\u5916\u306F\u78BA\u304B\u3081\u3066\u3044\u307E\u305B\u3093\u3002",incompleteDetail:"\u8A3C\u660E\u304C\u7D42\u308F\u3063\u3066\u3044\u307E\u305B\u3093\u3002\u3053\u306E\u4E3B\u5F35\u306F\u307E\u3060\u4FDD\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",planned:"\u8A3C\u660E\u4E88\u5B9A",plannedDetail:"\u307E\u3060\u8A3C\u660E\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u3053\u308C\u304B\u3089\u8A3C\u660E\u3059\u308B\u6027\u8CEA\u3068\u3057\u3066\u3001\u5408\u610F\u3092\u3068\u308B\u305F\u3081\u306E\u6848\u3067\u3059\u3002",target:"\u5BFE\u8C61",noClaims:"\u307E\u3060\u4E3B\u5F35\u304C\u3042\u308A\u307E\u305B\u3093\u3002",assumptions:"\u4EEE\u5B9A",bound:"\u78BA\u8A8D\u3057\u305F\u7BC4\u56F2",gaps:"\u7D42\u308F\u3063\u3066\u3044\u306A\u3044\u90E8\u5206",commentOn:a=>`${a}\u306B\u30B3\u30E1\u30F3\u30C8`,sendFailed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-view-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002"}}),j=$(b(),se(),E(1)),nt=y({id:W,text:j}),hn=ee("kind",[y({kind:V("proved"),assumptions:u(w(j))}),y({kind:V("bounded"),bound:j}),y({kind:V("incomplete"),gaps:u(w(j))}),y({kind:V("planned")})]),un=y({id:W,target:u(W),statement:j,subjects:u(w(nt)),premises:u(w(nt)),conclusions:$(w(nt),E(1,"a claim needs at least one conclusion")),examples:u(w(nt)),notClaimed:u(w(nt)),assurance:hn,source:u(y({tool:u(j),ref:j}))}),mn=y({id:W,name:j,meaning:j}),gn=y({id:W,name:j,code:u(j),summary:u(j)}),fn=y({targets:u(w(gn)),terms:u(w(mn)),claims:w(un)}),bn=()=>({targets:[],terms:[],claims:[]}),kn=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,vn=(a,t)=>{const e=[];let s=0;for(const n of a.matchAll(kn)){const i=(n[1]??"").trim(),
|
|
670
|
+
</div>`}}const Re=()=>{customElements.get("dpk-line-chart")||customElements.define("dpk-line-chart",De)},pn=D({en:{heading:"Formal spec",empty:"No claims.",dataError:"Could not load the specification data.",claims:a=>`${a} ${a===1?"claim":"claims"}`,subjects:"For",premises:"Given",conclusions:"Then",noPremises:"None \u2014 holds unconditionally",showDetails:"Show the details of this claim",hideDetails:"Hide the details of this claim",examples:"Examples",notClaimed:"Not claimed",usesTerms:"Terms",source:"Source",proved:"Proved",conditional:"Proved under assumptions",bounded:"Checked within bounds",incomplete:"Incomplete",provedDetail:"Machine-checked to hold in every case.",conditionalDetail:"Holds in every case, provided the assumptions are true.",boundedDetail:"Every case within the bound was checked; nothing outside it was.",incompleteDetail:"The proof is not finished. Nothing here is guaranteed yet.",planned:"Planned",plannedDetail:"Not proved yet: a property proposed to be proved, for agreement before the work starts.",target:"About",noClaims:"No claims yet.",assumptions:"Assumes",bound:"Checked within",gaps:"Unfinished",commentOn:a=>`Comment on ${a}`,sendFailed:"Could not send. Place this inside a dpk-view-* element."},ja:{heading:"\u5F62\u5F0F\u4ED5\u69D8",empty:"\u4E3B\u5F35\u304C\u3042\u308A\u307E\u305B\u3093\u3002",dataError:"\u4ED5\u69D8\u306E\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002",claims:a=>`${a} \u4EF6\u306E\u4E3B\u5F35`,subjects:"\u5165\u529B\u30FB\u72B6\u6CC1",premises:"\u524D\u63D0",conclusions:"\u7D50\u8AD6",noPremises:"\u306A\u3057 \u2014 \u7121\u6761\u4EF6\u306B\u6210\u308A\u7ACB\u3064",showDetails:"\u3053\u306E\u4E3B\u5F35\u306E\u8A73\u7D30\u3092\u958B\u304F",hideDetails:"\u3053\u306E\u4E3B\u5F35\u306E\u8A73\u7D30\u3092\u9589\u3058\u308B",examples:"\u5177\u4F53\u4F8B",notClaimed:"\u4E3B\u5F35\u3057\u3066\u3044\u306A\u3044\u3053\u3068",usesTerms:"\u4F7F\u3046\u7528\u8A9E",source:"\u51FA\u5178",proved:"\u8A3C\u660E\u6E08\u307F",conditional:"\u4EEE\u5B9A\u3064\u304D\u3067\u8A3C\u660E\u6E08\u307F",bounded:"\u7BC4\u56F2\u3092\u9650\u3063\u3066\u78BA\u8A8D",incomplete:"\u672A\u5B8C\u6210",provedDetail:"\u3059\u3079\u3066\u306E\u5834\u5408\u306B\u6210\u308A\u7ACB\u3064\u3053\u3068\u304C\u6A5F\u68B0\u7684\u306B\u78BA\u304B\u3081\u3089\u308C\u3066\u3044\u307E\u3059\u3002",conditionalDetail:"\u4EEE\u5B9A\u304C\u6B63\u3057\u3051\u308C\u3070\u3001\u3059\u3079\u3066\u306E\u5834\u5408\u306B\u6210\u308A\u7ACB\u3061\u307E\u3059\u3002",boundedDetail:"\u7BC4\u56F2\u5185\u306F\u3059\u3079\u3066\u306E\u5834\u5408\u3092\u78BA\u304B\u3081\u307E\u3057\u305F\u3002\u7BC4\u56F2\u306E\u5916\u306F\u78BA\u304B\u3081\u3066\u3044\u307E\u305B\u3093\u3002",incompleteDetail:"\u8A3C\u660E\u304C\u7D42\u308F\u3063\u3066\u3044\u307E\u305B\u3093\u3002\u3053\u306E\u4E3B\u5F35\u306F\u307E\u3060\u4FDD\u8A3C\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002",planned:"\u8A3C\u660E\u4E88\u5B9A",plannedDetail:"\u307E\u3060\u8A3C\u660E\u3057\u3066\u3044\u307E\u305B\u3093\u3002\u3053\u308C\u304B\u3089\u8A3C\u660E\u3059\u308B\u6027\u8CEA\u3068\u3057\u3066\u3001\u5408\u610F\u3092\u3068\u308B\u305F\u3081\u306E\u6848\u3067\u3059\u3002",target:"\u5BFE\u8C61",noClaims:"\u307E\u3060\u4E3B\u5F35\u304C\u3042\u308A\u307E\u305B\u3093\u3002",assumptions:"\u4EEE\u5B9A",bound:"\u78BA\u8A8D\u3057\u305F\u7BC4\u56F2",gaps:"\u7D42\u308F\u3063\u3066\u3044\u306A\u3044\u90E8\u5206",commentOn:a=>`${a}\u306B\u30B3\u30E1\u30F3\u30C8`,sendFailed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-view-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002"}}),j=$(b(),se(),E(1)),nt=y({id:W,text:j}),hn=ee("kind",[y({kind:V("proved"),assumptions:u(w(j))}),y({kind:V("bounded"),bound:j}),y({kind:V("incomplete"),gaps:u(w(j))}),y({kind:V("planned")})]),un=y({id:W,target:u(W),statement:j,subjects:u(w(nt)),premises:u(w(nt)),conclusions:$(w(nt),E(1,"a claim needs at least one conclusion")),examples:u(w(nt)),notClaimed:u(w(nt)),assurance:hn,source:u(y({tool:u(j),ref:j}))}),mn=y({id:W,name:j,meaning:j}),gn=y({id:W,name:j,code:u(j),summary:u(j)}),fn=y({targets:u(w(gn)),terms:u(w(mn)),claims:w(un)}),bn=()=>({targets:[],terms:[],claims:[]}),kn=/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,vn=(a,t)=>{const e=[];let s=0;for(const n of a.matchAll(kn)){const i=(n[1]??"").trim(),d=t.get(i);if(d===void 0)throw new Error(`unknown term reference: [[${i}]]`);n.index>s&&e.push({kind:"text",text:a.slice(s,n.index)}),e.push({kind:"term",id:i,label:n[2]?.trim()||d}),s=n.index+n[0].length}return s<a.length&&e.push({kind:"text",text:a.slice(s)}),e},je=a=>a.map(t=>t.kind==="text"?t.text:t.label).join(""),xn=a=>[...new Set(a.flatMap(t=>t.flatMap(e=>e.kind==="term"?[e.id]:[])))],mt=(a,t)=>{const e=new Set;for(const s of a){if(e.has(s))throw new Error(`duplicate ${t} id: ${s}`);e.add(s)}},qe=a=>{const t=B(fn,a),e=t.targets??[],s=t.terms??[];mt(e.map(p=>p.id),"target"),mt(s.map(p=>p.id),"term"),mt(t.claims.map(p=>p.id),"claim");const n=new Map(s.map(p=>[p.id,p.name])),i=p=>vn(p,n),d=s.map(p=>({id:p.id,name:p.name,meaning:i(p.meaning)})),l=e.map(p=>({id:p.id,name:p.name,code:p.code??null,summary:p.summary===void 0?null:i(p.summary)})),o=new Set(l.map(p=>p.id)),m=t.claims.map(p=>{if(p.target!==void 0&&!o.has(p.target))throw new Error(`unknown target (in claim ${p.id}): ${p.target}`);const f=U=>(U??[]).map(tt=>({id:tt.id,text:i(tt.text)})),S=f(p.subjects),O=f(p.premises),lt=f(p.conclusions),_=f(p.examples),Q=f(p.notClaimed),q=[...S,...O,...lt,..._,...Q];mt(q.map(U=>U.id),`clause (in claim ${p.id})`);const A=yn(p.assurance,i),P=i(p.statement);return{id:p.id,target:p.target??null,statement:P,subjects:S,premises:O,conclusions:lt,examples:_,notClaimed:Q,assurance:A,source:p.source===void 0?null:{tool:p.source.tool??null,ref:p.source.ref},terms:xn([P,...q.map(U=>U.text),...wn(A)])}});return{targets:l,terms:d,claims:m}},yn=(a,t)=>{switch(a.kind){case"proved":return{kind:"proved",assumptions:(a.assumptions??[]).map(t)};case"bounded":return{kind:"bounded",bound:t(a.bound)};case"incomplete":return{kind:"incomplete",gaps:(a.gaps??[]).map(t)};case"planned":return{kind:"planned"}}},wn=a=>{switch(a.kind){case"proved":return a.assumptions;case"bounded":return[a.bound];case"incomplete":return a.gaps;case"planned":return[]}},$n=a=>{const t={proved:0,conditional:0,bounded:0,incomplete:0,planned:0};for(const e of a.claims)t[Pe(e.assurance)?"conditional":e.assurance.kind]+=1;return t},Pe=a=>a.kind==="proved"&&a.assumptions.length>0,Ie=a=>{const t=new Map(a.targets.map(s=>[s.id,s])),e=new Map;for(const s of a.claims)e.set(s.target,[...e.get(s.target)??[],s]);for(const s of a.targets)e.has(s.id)||e.set(s.id,[]);return[...e].map(([s,n])=>({target:s===null?null:t.get(s)??null,claims:n}))},it=(a,t)=>t.length===0?{itemsLabel:null,items:t}:{itemsLabel:a,items:t},Dt=(a,t)=>{switch(t.kind){case"proved":return Pe(t)?{tone:"caveat",label:a.conditional,detail:a.conditionalDetail,...it(a.assumptions,t.assumptions)}:{tone:"sound",label:a.proved,detail:a.provedDetail,...it("",[])};case"bounded":return{tone:"caveat",label:a.bounded,detail:a.boundedDetail,...it(a.bound,[t.bound])};case"incomplete":return{tone:"unsound",label:a.incomplete,detail:a.incompleteDetail,...it(a.gaps,t.gaps)};case"planned":return{tone:"planned",label:a.planned,detail:a.plannedDetail,...it("",[])}}},Cn=a=>{switch(a.kind){case"target":return["target",a.target];case"claim":return["claim",a.claim];case"clause":return["clause",a.claim,a.clause]}},Sn=a=>[...a.subjects,...a.premises,...a.conclusions,...a.examples,...a.notClaimed],Oe=32,Ue=a=>{const t=je(a.statement);return t.length<=Oe?t:`${t.slice(0,Oe).trimEnd()}\u2026`},En=a=>[{target:{kind:"claim",claim:a.id},label:Ue(a)},...Sn(a).map(t=>({target:{kind:"clause",claim:a.id,clause:t.id},label:`${Ue(a)} \u203A ${je(t.text)}`}))],zn=a=>Ie(a).flatMap(t=>[...t.target===null?[]:[{target:{kind:"target",target:t.target.id},label:t.target.name}],...t.claims.flatMap(En)]),Tn=[M,K,yt,T`
|
|
671
671
|
:host {
|
|
672
672
|
display: block;
|
|
673
673
|
container-type: inline-size;
|
|
@@ -1171,18 +1171,18 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1171
1171
|
</header>
|
|
1172
1172
|
${s.summary===null?h:r`<p class="target-summary">${this.#C(s.summary)}</p>`}
|
|
1173
1173
|
${t.claims.length===0?r`<p class="spec-empty">${this.#c.noClaims}</p>`:e}
|
|
1174
|
-
</section>`}#R(t){const e=this.#c,s=Dt(e,t.assurance),n=this.#i.has(t.id),i=this.#A({kind:"assurance",claim:t.id}),
|
|
1174
|
+
</section>`}#R(t){const e=this.#c,s=Dt(e,t.assurance),n=this.#i.has(t.id),i=this.#A({kind:"assurance",claim:t.id}),d=Fe(t.id);return r`
|
|
1175
1175
|
<article class="claim" data-claim=${t.id} data-tone=${s.tone}>
|
|
1176
1176
|
<div
|
|
1177
1177
|
class="claim-head"
|
|
1178
1178
|
data-dpk-target=${this.#f({kind:"claim",claim:t.id})}
|
|
1179
|
-
@click=${
|
|
1179
|
+
@click=${l=>this.#S(l,t.id)}
|
|
1180
1180
|
>
|
|
1181
1181
|
<button
|
|
1182
1182
|
type="button"
|
|
1183
1183
|
class="dpk-icon-btn claim-toggle"
|
|
1184
1184
|
aria-expanded=${n?"true":"false"}
|
|
1185
|
-
aria-controls=${n?
|
|
1185
|
+
aria-controls=${n?d:h}
|
|
1186
1186
|
aria-label=${n?e.hideDetails:e.showDetails}
|
|
1187
1187
|
@click=${()=>this.#y(t.id)}
|
|
1188
1188
|
>
|
|
@@ -1202,7 +1202,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1202
1202
|
${s.label}
|
|
1203
1203
|
</button>
|
|
1204
1204
|
</div>
|
|
1205
|
-
${n?this.#j(t,
|
|
1205
|
+
${n?this.#j(t,d):h}
|
|
1206
1206
|
</article>
|
|
1207
1207
|
`}#j(t,e){const s=this.#c,n=Dt(s,t.assurance);return r`<div class="claim-body" id=${e}>
|
|
1208
1208
|
<dl class="claim-parts">
|
|
@@ -1279,11 +1279,11 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1279
1279
|
font-size: 11px;
|
|
1280
1280
|
color: var(--dpk-accent);
|
|
1281
1281
|
}
|
|
1282
|
-
`]}static{this.properties={id:{type:String,reflect:!0},heading:{type:String}}}#n=new R(this);#t=new pt(this);#e=new MutationObserver(()=>{this.#d()});#s=[];#a=new Set;#i="";constructor(){super(),this.id=this.getAttribute("id")??"",this.heading=null}connectedCallback(){super.connectedCallback(),this.#e.observe(this,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-dpk-item","data-dpk-label"]}),this.#d()}disconnectedCallback(){super.disconnectedCallback(),this.#e.disconnect()}get commentTargets(){if(!this.id)return[];const t=`${this.heading??this.#l.heading} \xB7 ${this.id}`;return this.#s.map(e=>({value:Ne(this.id,e),label:e.label,group:t}))}willUpdate(t){t.has("id")&&this.#p(),(t.has("id")||t.has("heading"))&&this.#h()}updated(){this.#t.sync(this.renderRoot.querySelector(".comment-pop"))}getContextMenuItems(t){const e=Ct(t.target,this.commentTargets,ae(this.#n.locale),(s,n)=>this.#r(s,n));return e===null?null:[e]}#r(t,e){const s=this.querySelector(`[data-dpk-target="${CSS.escape(t)}"]`);s!==null&&this.#t.open(t,s,e)}#o(t,e){return!this.dispatchEvent(new CustomEvent("dpk-comment-submit",{detail:{target:t,body:e},bubbles:!0,composed:!0,cancelable:!0}))}render(){return r`<slot></slot>${this.#t.render({locale:this.#n.locale,errorMessage:this.#l.sendFailed,submit:(t,e)=>this.#o(t,e)})}`}get#l(){return An(this.#n.locale)}#d(){const t=[...this.querySelectorAll(jn)].flatMap(s=>{if(s.parentElement?.closest(this.localName)!==this)return[];const n=Ln(s.getAttribute("data-dpk-item"));if(n===null)return[];const i=s.querySelector(qn)?.textContent??null,
|
|
1282
|
+
`]}static{this.properties={id:{type:String,reflect:!0},heading:{type:String}}}#n=new R(this);#t=new pt(this);#e=new MutationObserver(()=>{this.#d()});#s=[];#a=new Set;#i="";constructor(){super(),this.id=this.getAttribute("id")??"",this.heading=null}connectedCallback(){super.connectedCallback(),this.#e.observe(this,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["data-dpk-item","data-dpk-label"]}),this.#d()}disconnectedCallback(){super.disconnectedCallback(),this.#e.disconnect()}get commentTargets(){if(!this.id)return[];const t=`${this.heading??this.#l.heading} \xB7 ${this.id}`;return this.#s.map(e=>({value:Ne(this.id,e),label:e.label,group:t}))}willUpdate(t){t.has("id")&&this.#p(),(t.has("id")||t.has("heading"))&&this.#h()}updated(){this.#t.sync(this.renderRoot.querySelector(".comment-pop"))}getContextMenuItems(t){const e=Ct(t.target,this.commentTargets,ae(this.#n.locale),(s,n)=>this.#r(s,n));return e===null?null:[e]}#r(t,e){const s=this.querySelector(`[data-dpk-target="${CSS.escape(t)}"]`);s!==null&&this.#t.open(t,s,e)}#o(t,e){return!this.dispatchEvent(new CustomEvent("dpk-comment-submit",{detail:{target:t,body:e},bubbles:!0,composed:!0,cancelable:!0}))}render(){return r`<slot></slot>${this.#t.render({locale:this.#n.locale,errorMessage:this.#l.sendFailed,submit:(t,e)=>this.#o(t,e)})}`}get#l(){return An(this.#n.locale)}#d(){const t=[...this.querySelectorAll(jn)].flatMap(s=>{if(s.parentElement?.closest(this.localName)!==this)return[];const n=Ln(s.getAttribute("data-dpk-item"));if(n===null)return[];const i=s.querySelector(qn)?.textContent??null,d=Dn(s.getAttribute("data-dpk-label"),i,s.textContent,this.#l.untitled);return[{...n,label:d,element:s}]}),e=Rn(t);if(e.length<t.length){const s=new Set(e.map(rt)),n=[...new Set(t.map(rt).filter(i=>!s.has(i)))];console.warn(`[dev-process-kit] ${this.localName}#${this.id}: ambiguous data-dpk-item ignored:`,n)}this.#s=e,this.#p(),this.#h()}#p(){const t=new Set(this.#s.map(e=>e.element));for(const e of this.#a)t.has(e)||e.removeAttribute("data-dpk-target");for(const e of this.#s)e.element.setAttribute("data-dpk-target",Ne(this.id,e));this.#a=t}#h(){const t=JSON.stringify(this.commentTargets);t!==this.#i&&(this.#i=t,this.dispatchEvent(new CustomEvent("dpk-comment-targets-change",{bubbles:!0,composed:!0})))}}const Ge=()=>{customElements.get("dpk-commentable")||customElements.define("dpk-commentable",We)},Pn="dpk-extend-right-click-run",Rt=$(b(),E(1)),Z=$(b(),E(1)),In=y({kind:V("item"),id:Rt,label:Z,danger:u(at()),event:u(Z),detail:u(_s(b(),vt())),copy:u(Z)}),On=y({kind:V("submenu"),id:Rt,label:Z,entries:w(ne(()=>Ke))}),Ke=ne(()=>ee("kind",[In,On])),Un=y({id:Rt,heading:u(Z),entries:w(Ke)}),Fn=y({selector:$(b(),se(),E(1)),label:u(Z),groups:w(Un)}),Hn=y({targets:w(Fn)}),Ve=(a,t)=>{for(const e of a){if(t.has(e.id))throw new Error(`duplicate id: ${e.id}`);t.add(e.id),e.kind==="submenu"&&Ve(e.entries,t)}},jt=a=>{const t=B(Hn,a),e=new Set;for(const s of t.targets)for(const n of s.groups){if(e.has(n.id))throw new Error(`duplicate id: ${n.id}`);e.add(n.id),Ve(n.entries,e)}return t},Xe="dpk-extend-right-click",qt=`[dev-process-kit] ${Xe}: `,_n="text",Bn=(a,t)=>{const e=Bs(a,a),s=e.indexOf(t);return s===-1?null:[a,...e.slice(0,s)]},Nn=(a,t)=>{const s=(t===_n?a.textContent:a.getAttribute(t))?.trim()??"";return s===""?null:s},Wn=(a,t,e)=>{try{return a.matches(t)}catch{return e.has(t)||(e.add(t),console.warn(`${qt}invalid target selector ${JSON.stringify(t)} ignored`)),!1}};class Ye extends z{static{this.styles=T`
|
|
1283
1283
|
:host {
|
|
1284
1284
|
display: contents;
|
|
1285
1285
|
}
|
|
1286
|
-
`}static{this.properties={config:{attribute:!1}}}#n=null;#t=null;#e=null;#s=null;constructor(){super(),this.config=null}connectedCallback(){super.connectedCallback(),this.#e=N(this,jt,t=>{if(t.ok){this.#n=t.value,this.#t=null;return}this.#n=null,this.#t=t.error,console.warn(`${qt}JSON child ignored: ${t.error}`)})}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}get error(){return this.#t}getContextMenuItems(t){const e=this.#a();if(e===null)return null;const s=t.origin??null;if(!(s instanceof Element))return null;const n=Bn(s,this);if(n===null||n.some(
|
|
1286
|
+
`}static{this.properties={config:{attribute:!1}}}#n=null;#t=null;#e=null;#s=null;constructor(){super(),this.config=null}connectedCallback(){super.connectedCallback(),this.#e=N(this,jt,t=>{if(t.ok){this.#n=t.value,this.#t=null;return}this.#n=null,this.#t=t.error,console.warn(`${qt}JSON child ignored: ${t.error}`)})}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=null}get error(){return this.#t}getContextMenuItems(t){const e=this.#a();if(e===null)return null;const s=t.origin??null;if(!(s instanceof Element))return null;const n=Bn(s,this);if(n===null||n.some(l=>l.localName===Xe))return null;const i=this.#r(n,e);if(i===null)return null;const d=this.#o(i.target,i.element);return d.length===0?null:d}render(){return r`<slot></slot>`}#a(){return this.config===null?this.#n:(this.#s?.raw!==this.config&&(this.#s={raw:this.config,parsed:this.#i(this.config)}),this.#s.parsed)}#i(t){try{return jt(t)}catch(e){return console.warn(`${qt}config ignored: ${e instanceof Error?e.message:String(e)}`),null}}#r(t,e){const s=new Set;for(const n of t)for(const i of e.targets)if(Wn(n,i.selector,s))return{target:i,element:n};return null}#o(t,e){return t.groups.flatMap(s=>{const n=this.#l(s.entries,s,t,e);return n.length===0?[]:[s.heading===void 0?{id:s.id,entries:n}:{id:s.id,heading:s.heading,entries:n}]})}#l(t,e,s,n){return t.flatMap(i=>i.kind==="submenu"?this.#d(i,e,s,n):this.#p(i,e,s,n))}#d(t,e,s,n){const i=this.#l(t.entries,e,s,n);return i.length===0?[]:[{kind:"submenu",id:t.id,label:t.label,items:i}]}#p(t,e,s,n){const i=t.copy===void 0?null:Nn(n,t.copy);if(t.copy!==void 0&&i===null)return[];const d=()=>{i!==null&&wt(i),!(i!==null&&t.event===void 0)&&this.#h(t,e,s,n)};return[t.danger===!0?{kind:"item",id:t.id,label:t.label,run:d,danger:!0}:{kind:"item",id:t.id,label:t.label,run:d}]}#h(t,e,s,n){const i={id:t.id,group:e.id,item:t.id,target:{selector:s.selector,label:s.label??null},element:n,authored:t.detail??{}};this.dispatchEvent(new CustomEvent(t.event??Pn,{detail:i,bubbles:!0,composed:!0}))}}const Ze=()=>{customElements.get("dpk-extend-right-click")||customElements.define("dpk-extend-right-click",Ye)},Gn=D({en:{sendFailed:"Could not send. Place this inside a dpk-view-* element."},ja:{sendFailed:"\u9001\u4FE1\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-view-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002"}});class Je extends z{static{this.styles=[M,K,yt,T`
|
|
1287
1287
|
:host {
|
|
1288
1288
|
position: relative;
|
|
1289
1289
|
display: inline-block;
|
|
@@ -1405,7 +1405,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1405
1405
|
</div>
|
|
1406
1406
|
<div role="tabpanel" id="${this.#n}-panel" aria-labelledby="${this.#n}-tab-${s}">
|
|
1407
1407
|
<slot></slot>
|
|
1408
|
-
</div>`}updated(t){const e=this.#s,s=e.map(i=>i.dataset.name??""),n=e[ts(s,this.selected)];this.renderRoot.querySelector("slot")?.assign(...n===void 0?[]:[n]),this.#a()}#a(){const t=this.renderRoot.querySelector('[role="tablist"]'),e=this.renderRoot.querySelector('[role="tab"][aria-selected="true"]');t===null||e===null||(t.style.setProperty("--dpk-tabs-indicator-x",`${e.offsetLeft}px`),t.style.setProperty("--dpk-tabs-indicator-w",`${e.offsetWidth}px`),!(t.hasAttribute("data-ready")||typeof requestAnimationFrame!="function")&&requestAnimationFrame(()=>{t.setAttribute("data-ready","")}))}#i(t){t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("dpk-tab-change",{detail:{name:t},bubbles:!0,composed:!0})))}#r=t=>{const e=[...this.renderRoot.querySelectorAll('[role="tab"]')],s=e.findIndex(
|
|
1408
|
+
</div>`}updated(t){const e=this.#s,s=e.map(i=>i.dataset.name??""),n=e[ts(s,this.selected)];this.renderRoot.querySelector("slot")?.assign(...n===void 0?[]:[n]),this.#a()}#a(){const t=this.renderRoot.querySelector('[role="tablist"]'),e=this.renderRoot.querySelector('[role="tab"][aria-selected="true"]');t===null||e===null||(t.style.setProperty("--dpk-tabs-indicator-x",`${e.offsetLeft}px`),t.style.setProperty("--dpk-tabs-indicator-w",`${e.offsetWidth}px`),!(t.hasAttribute("data-ready")||typeof requestAnimationFrame!="function")&&requestAnimationFrame(()=>{t.setAttribute("data-ready","")}))}#i(t){t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("dpk-tab-change",{detail:{name:t},bubbles:!0,composed:!0})))}#r=t=>{const e=[...this.renderRoot.querySelectorAll('[role="tab"]')],s=e.findIndex(d=>d.getAttribute("aria-selected")==="true"),n=Kn(t.key,s,e.length);if(n===null)return;t.preventDefault();const i=this.#s[n]?.dataset.name;i!==void 0&&this.#i(i),this.updateComplete.then(()=>{e[n]?.focus()})}}const ss=()=>{customElements.get("dpk-tabs")||customElements.define("dpk-tabs",es)},Yn=D({en:{heading:"Checklist",empty:"No items.",progress:(a,t)=>`${a} / ${t} done`,actionTitle:(a,t)=>`${t?"Checked":"Unchecked"}: ${a}`,unrecorded:"Could not record it. Place this inside a dpk-view-* element.",comment:"Comment",commentOn:a=>`Comment on ${a}`},ja:{heading:"\u30C1\u30A7\u30C3\u30AF\u30EA\u30B9\u30C8",empty:"\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\u3002",progress:(a,t)=>`${a} / ${t} \u5B8C\u4E86`,actionTitle:(a,t)=>`${t?"\u30C1\u30A7\u30C3\u30AF":"\u30C1\u30A7\u30C3\u30AF\u89E3\u9664"}: ${a}`,unrecorded:"\u8A18\u9332\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08dpk-view-* \u8981\u7D20\u306E\u4E2D\u306B\u7F6E\u3044\u3066\u304F\u3060\u3055\u3044\uFF09\u3002",comment:"\u30B3\u30E1\u30F3\u30C8",commentOn:a=>`${a} \u306B\u30B3\u30E1\u30F3\u30C8`}}),as="SET_CHECKED",Zn=y({id:$(b(),ie(/^[A-Za-z0-9_-]+$/)),label:$(b(),E(1)),checked:u(at()),note:u(b())}),Jn=y({items:w(Zn)}),ns=()=>({items:[]}),is=a=>{const t=B(Jn,a),e=new Set;return{items:t.items.map(s=>{if(e.has(s.id))throw new Error(`duplicate item id: ${s.id}`);return e.add(s.id),{id:s.id,label:s.label,checked:s.checked??!1,note:s.note??null,changed:!1}})}},Qn=kt({checked:at()}),ti=(a,t,e)=>{const s=new Map(t.items.map(d=>[d.id,d.checked])),n=new Map(s),i=e.map(d=>{if(d.type!==as)return{id:d.id,title:d.type,stale:"unsupported-action-type"};const l=ba(d.target.id),o=l?.[1]==="item"?l[2]:void 0,m=Zt(Qn,d.payload);if(o===void 0||!n.has(o)||!m.success)return{id:d.id,title:a.actionTitle(o??d.target.id,!0),stale:"target-missing"};n.set(o,m.output.checked);const p=t.items.find(f=>f.id===o)?.label??o;return{id:d.id,title:a.actionTitle(p,m.output.checked),tone:"update"}});return{data:{items:t.items.map(d=>{const l=n.get(d.id)??d.checked;return{...d,checked:l,changed:l!==s.get(d.id)}})},results:i}},ei=a=>({done:a.items.filter(t=>t.checked).length,total:a.items.length});class rs extends z{static{this.styles=[M,T`
|
|
1409
1409
|
:host {
|
|
1410
1410
|
display: block;
|
|
1411
1411
|
color: var(--dpk-ink);
|
|
@@ -1649,7 +1649,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1649
1649
|
>
|
|
1650
1650
|
${Ns()}
|
|
1651
1651
|
</button>`:h}
|
|
1652
|
-
</li>`}#h(t,e){const s=new CustomEvent("dpk-element-action",{detail:{type:as,target:this.#c(t.id),payload:{checked:e}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(s),this.#o=s.defaultPrevented?null:t.id,this.requestUpdate()}#u(t){this.dispatchEvent(new CustomEvent("dpk-comment-request",{detail:{target:this.#c(t)},bubbles:!0,composed:!0}))}#c(t){return`element:${encodeURIComponent(this.id)}/item/${encodeURIComponent(t)}`}#m(){if(this.#e===null)this.#a=ns(),this.#r=this.#i.map(t=>({id:t.id,title:t.type,stale:"target-missing"}));else{const t=ti(this.#l,this.#e,this.#i);this.#a=t.data,this.#r=t.results}this.requestUpdate()}}const os=()=>{customElements.get("dpk-checklist")||customElements.define("dpk-checklist",rs)},v=(a,t,e)=>e===void 0?{kind:a,pattern:t}:{kind:a,pattern:t,next:e},ot=v(null,/\s+/y),Pt=v("string",/"(?:\\.|[^\\"\n])*"?|'(?:\\.|[^\\'\n])*'?/y),It=v("comment",/\/\*[\s\S]*?(?:\*\/|$)/y),si=["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","keyof","let","new","null","of","private","protected","public","readonly","return","satisfies","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","yield"],ai={js:{start:"code",rules:{code:[ot,v("comment",/\/\/[^\n]*/y),It,v("string",/`(?:\\[\s\S]|[^\\`])*`?/y),Pt,v("number",/(?:0[xob][\da-f_]+|\d[\d_]*(?:\.\d+)?(?:e[+-]?\d+)?)n?/iy),v("keyword",new RegExp(`(?:${si.join("|")})(?![\\w$])`,"y")),v("function",/[A-Za-z_$][\w$]*(?=\s*\()/y),v(null,/[A-Za-z_$][\w$]*/y)]}},html:{start:"text",rules:{text:[v("comment",/<!--[\s\S]*?(?:-->|$)/y),v("keyword",/&#?\w+;/y),v("tag",/<\/?[A-Za-z][\w:.-]*/y,"tag"),v(null,/[^<&]+/y)],tag:[ot,v("tag",/\/?>/y,"text"),v("punct",/=/y),v("string",/"[^"]*"?|'[^']*'?/y),v("attr",/[^\s=>/"']+/y)]}},css:{start:"sheet",rules:{sheet:[ot,It,Pt,v("keyword",/@[\w-]+/y),v("punct",/[{}]/y),v("tag",/[^{};]+(?=\{)/y),v("property",/-{0,2}[A-Za-z][\w-]*(?=\s*:)/y),v("number",/#[\da-f]{3,8}(?![\w-])/iy),v(null,/-?[A-Za-z_][\w-]*/y),v("number",/-?(?:\d*\.)?\d+[a-z%]*/iy)]}},json:{start:"value",rules:{value:[ot,v("comment",/\/\/[^\n]*/y),It,v("property",/"(?:\\.|[^\\"\n])*"(?=\s*:)/y),v("string",/"(?:\\.|[^\\"\n])*"?/y),v("number",/-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/iy),v("keyword",/(?:true|false|null)(?!\w)/y)]}},sh:{start:"line",rules:{line:[ot,v("comment",/(?<!\S)#[^\n]*/y),Pt,v("keyword",/\$\{[^}\n]*\}?|\$\w+/y),v("attr",/(?<!\S)--?[\w-]+/y),v(null,/[^\s"'$#]+/y)]}}},ni={js:"js",javascript:"js",jsx:"js",mjs:"js",cjs:"js",ts:"js",typescript:"js",tsx:"js",mts:"js",html:"html",xml:"html",svg:"html",vue:"html",css:"css",json:"json",jsonc:"json",json5:"json",sh:"sh",bash:"sh",zsh:"sh",shell:"sh",console:"sh"},ii=a=>a===null?null:ni[a.trim().toLowerCase()]??null,ls=(a,t,e)=>{const s=a.at(-1);t===null&&s!==void 0&&s.kind===null?a[a.length-1]={kind:t,text:s.text+e}:a.push({kind:t,text:e})},ds=(a,t)=>{const e=ii(t);if(e===null)return a===""?[]:[{kind:null,text:a}];const{start:s,rules:n}=ai[e],i=[];let
|
|
1652
|
+
</li>`}#h(t,e){const s=new CustomEvent("dpk-element-action",{detail:{type:as,target:this.#c(t.id),payload:{checked:e}},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(s),this.#o=s.defaultPrevented?null:t.id,this.requestUpdate()}#u(t){this.dispatchEvent(new CustomEvent("dpk-comment-request",{detail:{target:this.#c(t)},bubbles:!0,composed:!0}))}#c(t){return`element:${encodeURIComponent(this.id)}/item/${encodeURIComponent(t)}`}#m(){if(this.#e===null)this.#a=ns(),this.#r=this.#i.map(t=>({id:t.id,title:t.type,stale:"target-missing"}));else{const t=ti(this.#l,this.#e,this.#i);this.#a=t.data,this.#r=t.results}this.requestUpdate()}}const os=()=>{customElements.get("dpk-checklist")||customElements.define("dpk-checklist",rs)},v=(a,t,e)=>e===void 0?{kind:a,pattern:t}:{kind:a,pattern:t,next:e},ot=v(null,/\s+/y),Pt=v("string",/"(?:\\.|[^\\"\n])*"?|'(?:\\.|[^\\'\n])*'?/y),It=v("comment",/\/\*[\s\S]*?(?:\*\/|$)/y),si=["abstract","as","async","await","break","case","catch","class","const","continue","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","keyof","let","new","null","of","private","protected","public","readonly","return","satisfies","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","yield"],ai={js:{start:"code",rules:{code:[ot,v("comment",/\/\/[^\n]*/y),It,v("string",/`(?:\\[\s\S]|[^\\`])*`?/y),Pt,v("number",/(?:0[xob][\da-f_]+|\d[\d_]*(?:\.\d+)?(?:e[+-]?\d+)?)n?/iy),v("keyword",new RegExp(`(?:${si.join("|")})(?![\\w$])`,"y")),v("function",/[A-Za-z_$][\w$]*(?=\s*\()/y),v(null,/[A-Za-z_$][\w$]*/y)]}},html:{start:"text",rules:{text:[v("comment",/<!--[\s\S]*?(?:-->|$)/y),v("keyword",/&#?\w+;/y),v("tag",/<\/?[A-Za-z][\w:.-]*/y,"tag"),v(null,/[^<&]+/y)],tag:[ot,v("tag",/\/?>/y,"text"),v("punct",/=/y),v("string",/"[^"]*"?|'[^']*'?/y),v("attr",/[^\s=>/"']+/y)]}},css:{start:"sheet",rules:{sheet:[ot,It,Pt,v("keyword",/@[\w-]+/y),v("punct",/[{}]/y),v("tag",/[^{};]+(?=\{)/y),v("property",/-{0,2}[A-Za-z][\w-]*(?=\s*:)/y),v("number",/#[\da-f]{3,8}(?![\w-])/iy),v(null,/-?[A-Za-z_][\w-]*/y),v("number",/-?(?:\d*\.)?\d+[a-z%]*/iy)]}},json:{start:"value",rules:{value:[ot,v("comment",/\/\/[^\n]*/y),It,v("property",/"(?:\\.|[^\\"\n])*"(?=\s*:)/y),v("string",/"(?:\\.|[^\\"\n])*"?/y),v("number",/-?\d+(?:\.\d+)?(?:e[+-]?\d+)?/iy),v("keyword",/(?:true|false|null)(?!\w)/y)]}},sh:{start:"line",rules:{line:[ot,v("comment",/(?<!\S)#[^\n]*/y),Pt,v("keyword",/\$\{[^}\n]*\}?|\$\w+/y),v("attr",/(?<!\S)--?[\w-]+/y),v(null,/[^\s"'$#]+/y)]}}},ni={js:"js",javascript:"js",jsx:"js",mjs:"js",cjs:"js",ts:"js",typescript:"js",tsx:"js",mts:"js",html:"html",xml:"html",svg:"html",vue:"html",css:"css",json:"json",jsonc:"json",json5:"json",sh:"sh",bash:"sh",zsh:"sh",shell:"sh",console:"sh"},ii=a=>a===null?null:ni[a.trim().toLowerCase()]??null,ls=(a,t,e)=>{const s=a.at(-1);t===null&&s!==void 0&&s.kind===null?a[a.length-1]={kind:t,text:s.text+e}:a.push({kind:t,text:e})},ds=(a,t)=>{const e=ii(t);if(e===null)return a===""?[]:[{kind:null,text:a}];const{start:s,rules:n}=ai[e],i=[];let d=s,l=0;for(;l<a.length;){const o=(n[d]??[]).find(m=>(m.pattern.lastIndex=l,m.pattern.test(a)&&m.pattern.lastIndex>l));if(o===void 0){ls(i,null,a.charAt(l)),l+=1;continue}ls(i,o.kind,a.slice(l,o.pattern.lastIndex)),l=o.pattern.lastIndex,d=o.next??d}return i},cs=D({en:{copy:"Copy",copied:"Copied",copyFailed:"Copy failed",copyLabel:a=>`Copy ${a}`,code:"code"},ja:{copy:"\u30B3\u30D4\u30FC",copied:"\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F",copyFailed:"\u30B3\u30D4\u30FC\u5931\u6557",copyLabel:a=>`${a} \u3092\u30B3\u30D4\u30FC`,code:"\u30B3\u30FC\u30C9"}}),ps=T`
|
|
1653
1653
|
:host {
|
|
1654
1654
|
display: block;
|
|
1655
1655
|
overflow: hidden;
|
|
@@ -1845,10 +1845,10 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1845
1845
|
display: none;
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
|
-
`;class ms extends z{static{this.styles=[M,ps,ci]}static{this.properties={data:{attribute:!1}}}#n=new R(this);#t=null;#e=null;#s=0;#a="idle";#i;#r=null;constructor(){super(),this.data=null}connectedCallback(){super.connectedCallback(),this.#r=N(this,gt,t=>{this.#s=0,t.ok?this.data=t.value:(this.#t=null,this.#e=t.error,this.requestUpdate())}),queueMicrotask(()=>{if(this.#t!==null||this.#e!==null)return;const t=Zs(this,gt);t!==null&&(this.#r?.(),this.#r=null,this.#s=0,t.ok?this.data=t.value:(this.#t=null,this.#e=t.error,this.requestUpdate()))})}disconnectedCallback(){super.disconnectedCallback(),this.#r?.(),this.#r=null,clearTimeout(this.#i)}willUpdate(t){if(t.has("data")){if(this.data===null){this.#t=null;return}try{this.#t=gt(this.data),this.#e=null,this.#s=0}catch(e){this.#t=null,this.#e=e instanceof Error?e.message:String(e)}}}render(){const t=cs(this.#n.locale),e=oi(this.#n.locale),s=this.#t;if(this.#e!==null)return this.#o(t.code,r`<p class="empty">${e.invalid(this.#e)}</p>`);if(s===null||s.variants.length===0)return this.#o(t.code,r`<p class="empty">${e.empty}</p>`);const n=Math.min(this.#s,s.variants.length-1),i=s.label===""?t.code:s.label,
|
|
1848
|
+
`;class ms extends z{static{this.styles=[M,ps,ci]}static{this.properties={data:{attribute:!1}}}#n=new R(this);#t=null;#e=null;#s=0;#a="idle";#i;#r=null;constructor(){super(),this.data=null}connectedCallback(){super.connectedCallback(),this.#r=N(this,gt,t=>{this.#s=0,t.ok?this.data=t.value:(this.#t=null,this.#e=t.error,this.requestUpdate())}),queueMicrotask(()=>{if(this.#t!==null||this.#e!==null)return;const t=Zs(this,gt);t!==null&&(this.#r?.(),this.#r=null,this.#s=0,t.ok?this.data=t.value:(this.#t=null,this.#e=t.error,this.requestUpdate()))})}disconnectedCallback(){super.disconnectedCallback(),this.#r?.(),this.#r=null,clearTimeout(this.#i)}willUpdate(t){if(t.has("data")){if(this.data===null){this.#t=null;return}try{this.#t=gt(this.data),this.#e=null,this.#s=0}catch(e){this.#t=null,this.#e=e instanceof Error?e.message:String(e)}}}render(){const t=cs(this.#n.locale),e=oi(this.#n.locale),s=this.#t;if(this.#e!==null)return this.#o(t.code,r`<p class="empty">${e.invalid(this.#e)}</p>`);if(s===null||s.variants.length===0)return this.#o(t.code,r`<p class="empty">${e.empty}</p>`);const n=Math.min(this.#s,s.variants.length-1),i=s.label===""?t.code:s.label,d=this.#a==="copied"?t.copied:this.#a==="failed"?t.copyFailed:t.copy;return r`<div class="bar">
|
|
1849
1849
|
${s.label===""?h:r`<span class="name">${s.label}</span>`}
|
|
1850
1850
|
<div class="tabs" role="tablist" aria-label=${i}>
|
|
1851
|
-
${s.variants.map((
|
|
1851
|
+
${s.variants.map((l,o)=>r`<button
|
|
1852
1852
|
type="button"
|
|
1853
1853
|
role="tab"
|
|
1854
1854
|
id="code-group-tab-${o}"
|
|
@@ -1856,9 +1856,9 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1856
1856
|
aria-selected=${o===n}
|
|
1857
1857
|
tabindex=${o===n?0:-1}
|
|
1858
1858
|
@click=${()=>this.#l(o)}
|
|
1859
|
-
@keydown=${
|
|
1859
|
+
@keydown=${m=>this.#d(m,o)}
|
|
1860
1860
|
>
|
|
1861
|
-
${
|
|
1861
|
+
${l.label}
|
|
1862
1862
|
</button>`)}
|
|
1863
1863
|
</div>
|
|
1864
1864
|
<button
|
|
@@ -1867,16 +1867,16 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1867
1867
|
aria-label=${t.copyLabel(i)}
|
|
1868
1868
|
@click=${()=>this.#h()}
|
|
1869
1869
|
>
|
|
1870
|
-
${this.#a==="copied"?ct():re()}<span aria-live="polite">${
|
|
1870
|
+
${this.#a==="copied"?ct():re()}<span aria-live="polite">${d}</span>
|
|
1871
1871
|
</button>
|
|
1872
1872
|
</div>
|
|
1873
|
-
${s.variants.map((
|
|
1873
|
+
${s.variants.map((l,o)=>r`<pre
|
|
1874
1874
|
role="tabpanel"
|
|
1875
1875
|
id="code-group-panel-${o}"
|
|
1876
1876
|
aria-labelledby="code-group-tab-${o}"
|
|
1877
1877
|
?hidden=${o!==n}
|
|
1878
|
-
><code>${this.#p(
|
|
1879
|
-
${e}`}#l(t){this.#t!==null&&(this.#s=Math.max(0,Math.min(t,this.#t.variants.length-1)),this.#a="idle",this.requestUpdate())}#d(t,e){if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;const s=this.#t?.variants.length??0;if(s===0)return;t.preventDefault();const n=(e+(t.key==="ArrowRight"?1:-1)+s)%s;this.#l(n),this.renderRoot.querySelectorAll('[role="tab"]')[n]?.focus()}#p(t){const e=t.language===""?null:t.language;return ds(Ot(t.code),e).map(s=>s.kind===null?s.text:r`<span class=${s.kind}>${s.text}</span>`)}async#h(){const t=this.#t;if(t===null)return;const e=Math.min(this.#s,t.variants.length-1),s=t.variants[e];if(s===void 0)return;const n=await wt(Ot(s.code));this.#a=n?"copied":"failed",this.requestUpdate(),clearTimeout(this.#i),this.#i=setTimeout(()=>{this.#a="idle",this.requestUpdate()},1600)}}const gs=()=>{customElements.get("dpk-code-group")||customElements.define("dpk-code-group",ms)},pi=D({en:{back:"Back",forward:"Forward",reload:"Reload",address:"Address",tabs:"Tabs",newTab:"New tab",closeTab:"Close tab",profile:a=>`Profile: ${a}`,guest:"Guest",shortcuts:"Pages of this site",unreachableTitle:"This site can\u2019t be reached",unreachableBody:"No page here has this address."},ja:{back:"\u623B\u308B",forward:"\u9032\u3080",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",address:"\u30A2\u30C9\u30EC\u30B9",tabs:"\u30BF\u30D6",newTab:"\u65B0\u3057\u3044\u30BF\u30D6",closeTab:"\u30BF\u30D6\u3092\u9589\u3058\u308B",profile:a=>`\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB: ${a}`,guest:"\u30B2\u30B9\u30C8",shortcuts:"\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30DA\u30FC\u30B8",unreachableTitle:"\u3053\u306E\u30B5\u30A4\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",unreachableBody:"\u3053\u306E\u30A2\u30C9\u30EC\u30B9\u306E\u30DA\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),ft=(a,t,e)=>{const s=le(t,e);if(s===null)return;const n=de(s);return a.find(i=>{const
|
|
1878
|
+
><code>${this.#p(l)}</code></pre>`)}`}#o(t,e){return r`<div class="bar"><span class="name">${t}</span></div>
|
|
1879
|
+
${e}`}#l(t){this.#t!==null&&(this.#s=Math.max(0,Math.min(t,this.#t.variants.length-1)),this.#a="idle",this.requestUpdate())}#d(t,e){if(t.key!=="ArrowLeft"&&t.key!=="ArrowRight")return;const s=this.#t?.variants.length??0;if(s===0)return;t.preventDefault();const n=(e+(t.key==="ArrowRight"?1:-1)+s)%s;this.#l(n),this.renderRoot.querySelectorAll('[role="tab"]')[n]?.focus()}#p(t){const e=t.language===""?null:t.language;return ds(Ot(t.code),e).map(s=>s.kind===null?s.text:r`<span class=${s.kind}>${s.text}</span>`)}async#h(){const t=this.#t;if(t===null)return;const e=Math.min(this.#s,t.variants.length-1),s=t.variants[e];if(s===void 0)return;const n=await wt(Ot(s.code));this.#a=n?"copied":"failed",this.requestUpdate(),clearTimeout(this.#i),this.#i=setTimeout(()=>{this.#a="idle",this.requestUpdate()},1600)}}const gs=()=>{customElements.get("dpk-code-group")||customElements.define("dpk-code-group",ms)},pi=D({en:{back:"Back",forward:"Forward",reload:"Reload",address:"Address",tabs:"Tabs",newTab:"New tab",closeTab:"Close tab",profile:a=>`Profile: ${a}`,guest:"Guest",shortcuts:"Pages of this site",unreachableTitle:"This site can\u2019t be reached",unreachableBody:"No page here has this address."},ja:{back:"\u623B\u308B",forward:"\u9032\u3080",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",address:"\u30A2\u30C9\u30EC\u30B9",tabs:"\u30BF\u30D6",newTab:"\u65B0\u3057\u3044\u30BF\u30D6",closeTab:"\u30BF\u30D6\u3092\u9589\u3058\u308B",profile:a=>`\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB: ${a}`,guest:"\u30B2\u30B9\u30C8",shortcuts:"\u3053\u306E\u30B5\u30A4\u30C8\u306E\u30DA\u30FC\u30B8",unreachableTitle:"\u3053\u306E\u30B5\u30A4\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093",unreachableBody:"\u3053\u306E\u30A2\u30C9\u30EC\u30B9\u306E\u30DA\u30FC\u30B8\u306F\u3042\u308A\u307E\u305B\u3093\u3002"}}),ft=(a,t,e)=>{const s=le(t,e);if(s===null)return;const n=de(s);return a.find(i=>{const d=le(i.url,e);return d!==null&&de(d)===n})},hi=(a,t,e)=>t===void 0||t.kind==="new-tab"?e:t.kind==="unreachable"?ce(t.url):ft(a,t.page.url,t.page.url)?.title??ce(t.page.url),fs=a=>a===void 0||a.kind==="new-tab"?"":a.kind==="unreachable"?a.url:a.page.url,ui=(a,t,e,s)=>{const n=ia(t),i=n.history[n.index];return{tabs:t.tabs.map(d=>{const l=d.history[d.index];return{id:d.id,title:hi(a,l,e),url:fs(l),active:d.id===n.id}}),entry:i,url:fs(i),canBack:oa(t),canForward:ra(t),...s===null||s===""?{}:{profile:s}}},mi=a=>a.map(t=>({title:t.title,url:t.url.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").replace(/\/$/,""),href:t.url,page:{url:t.url}})),gi=":scope > [data-url]",fi=360,bs="https://page.example.com/";class ks extends z{static{this.shadowRootOptions={...z.shadowRootOptions,slotAssignment:"manual"}}static{this.styles=[M,la,T`
|
|
1880
1880
|
:host {
|
|
1881
1881
|
display: block;
|
|
1882
1882
|
height: var(--dpk-browser-height, 460px);
|
|
@@ -1916,17 +1916,17 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
1916
1916
|
::slotted(*) {
|
|
1917
1917
|
flex: 1 0 auto;
|
|
1918
1918
|
}
|
|
1919
|
-
`]}static{this.properties={url:{type:String},viewport:{type:String,reflect:!0},profile:{type:String}}}#n=new R(this);#t=new MutationObserver(()=>{this.requestUpdate()});#e=null;#s=!1;#a=null;#i=!1;#r=null;constructor(){super(),this.url=null,this.viewport="desktop",this.profile=null}connectedCallback(){super.connectedCallback(),this.#t.observe(this,{childList:!0,attributes:!0,attributeFilter:["data-url","data-title"]}),this.addEventListener("click",this.#k),this.addEventListener("auxclick",this.#k)}disconnectedCallback(){super.disconnectedCallback(),this.#t.disconnect(),this.removeEventListener("click",this.#k),this.removeEventListener("auxclick",this.#k),this.#a!==null&&clearTimeout(this.#a),this.#a=null}get#o(){return pi(this.#n.locale)}get#l(){return this.viewport==="mobile"}get#d(){return[...this.querySelectorAll(gi)]}get#p(){return this.#d.map(t=>{const e=t.dataset.url??"",s=t.querySelector("h1, h2, h3")?.textContent?.trim();return{url:e,title:t.dataset.title??(s||e)}})}get#h(){const t=this.#e===null?void 0:$t(this.#e);return t?.kind==="page"?t.page.url:this.#p[0]?.url??bs}#u(t){if(t?.kind!=="page")return;const e=ft(this.#p,t.page.url,t.page.url);return e===void 0?void 0:this.#d.find(s=>s.dataset.url===e.url)}willUpdate(t){if(this.#e===null){const e=this.#p,s=(this.url===null?void 0:ft(e,this.url,bs))??e[0];s!==void 0&&(this.#e=da({url:s.url}));return}t.has("url")&&this.url!==null&&this.#g(this.url,!1)}render(){const t=this.#e;if(t===null)return r`<slot hidden></slot>`;const e=this.#o,s=this.#p,n=ui(s,t,e.newTab,this.profile),i={view:n,phone:this.#l,switcher:this.#s,shortcuts:n.entry?.kind==="new-tab"?mi(s):[],labels:e,send:
|
|
1919
|
+
`]}static{this.properties={url:{type:String},viewport:{type:String,reflect:!0},profile:{type:String}}}#n=new R(this);#t=new MutationObserver(()=>{this.requestUpdate()});#e=null;#s=!1;#a=null;#i=!1;#r=null;constructor(){super(),this.url=null,this.viewport="desktop",this.profile=null}connectedCallback(){super.connectedCallback(),this.#t.observe(this,{childList:!0,attributes:!0,attributeFilter:["data-url","data-title"]}),this.addEventListener("click",this.#k),this.addEventListener("auxclick",this.#k)}disconnectedCallback(){super.disconnectedCallback(),this.#t.disconnect(),this.removeEventListener("click",this.#k),this.removeEventListener("auxclick",this.#k),this.#a!==null&&clearTimeout(this.#a),this.#a=null}get#o(){return pi(this.#n.locale)}get#l(){return this.viewport==="mobile"}get#d(){return[...this.querySelectorAll(gi)]}get#p(){return this.#d.map(t=>{const e=t.dataset.url??"",s=t.querySelector("h1, h2, h3")?.textContent?.trim();return{url:e,title:t.dataset.title??(s||e)}})}get#h(){const t=this.#e===null?void 0:$t(this.#e);return t?.kind==="page"?t.page.url:this.#p[0]?.url??bs}#u(t){if(t?.kind!=="page")return;const e=ft(this.#p,t.page.url,t.page.url);return e===void 0?void 0:this.#d.find(s=>s.dataset.url===e.url)}willUpdate(t){if(this.#e===null){const e=this.#p,s=(this.url===null?void 0:ft(e,this.url,bs))??e[0];s!==void 0&&(this.#e=da({url:s.url}));return}t.has("url")&&this.url!==null&&this.#g(this.url,!1)}render(){const t=this.#e;if(t===null)return r`<slot hidden></slot>`;const e=this.#o,s=this.#p,n=ui(s,t,e.newTab,this.profile),i={view:n,phone:this.#l,switcher:this.#s,shortcuts:n.entry?.kind==="new-tab"?mi(s):[],labels:e,send:l=>{this.#m(l)}},d=this.#u(n.entry);return r`<div
|
|
1920
1920
|
class="browser"
|
|
1921
1921
|
data-viewport=${this.#l?"mobile":"desktop"}
|
|
1922
1922
|
?data-loading=${this.#a!==null}
|
|
1923
1923
|
>
|
|
1924
1924
|
${ca(i)}
|
|
1925
1925
|
<div class="browser-page">
|
|
1926
|
-
${pa(i,
|
|
1926
|
+
${pa(i,d===void 0?void 0:r`<slot></slot>`)}
|
|
1927
1927
|
</div>
|
|
1928
1928
|
${ha(i)}
|
|
1929
|
-
</div>`}updated(){const t=this.#e===null?void 0:$t(this.#e),e=this.#u(t);this.renderRoot.querySelector("slot")?.assign(...e===void 0?[]:[e]),this.#i&&(this.#i=!1,this.renderRoot.querySelector('.browser-tab[aria-selected="true"]')?.focus());const s=t===void 0||t.kind==="new-tab"?"":t.kind==="page"?t.page.url:t.url;if(s===this.#r)return;const n=this.#r===null;this.#r=s,n||this.dispatchEvent(new CustomEvent("dpk-browser-navigate",{detail:{url:s},bubbles:!0,composed:!0}))}#c(t){if(this.#e===null)return;const e=ua(this.#e,t);e!==this.#e&&(this.#e=e,this.#f(),this.renderRoot.querySelector(".browser-page")?.scrollTo?.({top:0}),this.requestUpdate())}#m(t){switch(t.kind){case"reload":this.#v();return;case"address":this.#g(t.input,!1);return;case"back":case"forward":case"new-tab":this.#s=!1,this.#c({kind:t.kind}),this.requestUpdate();return;case"switcher":this.#s=t.open,this.requestUpdate();return;case"activate":this.#s=!1,this.#i=t.focus===!0,this.#c({kind:"activate",id:t.id}),this.requestUpdate();return;case"close-tab":this.#c({kind:"close-tab",id:t.id});return;case"visit":this.#c({kind:"visit",page:t.page});return;default:return}}#g(t,e){const s=this.#h,n=ft(this.#p,t,s),i=n===void 0?{kind:"unreachable",url:ma(t,s)}:{kind:"page",page:{url:n.url}};e!==!1?this.#c({kind:"open-tab",entry:i,background:e.background}):i.kind==="page"?this.#c({kind:"visit",page:i.page}):this.#c({kind:"unreachable",url:i.url})}#v(){if(this.#a!==null||this.#e===null)return;const t=this.#u($t(this.#e));this.#a=setTimeout(()=>{if(this.#a=null,t!==void 0){for(const e of t.querySelectorAll("form"))e.reset();for(const e of t.querySelectorAll("dialog"))e.close();t.scrollTop=0,t.dispatchEvent(new CustomEvent("dpk-reload",{bubbles:!0}))}this.renderRoot.querySelector(".browser-page")?.scrollTo?.({top:0}),this.requestUpdate()},fi),this.requestUpdate()}#f(){this.#a!==null&&(clearTimeout(this.#a),this.#a=null)}#k=t=>{if(t.defaultPrevented||this.#e===null||t.type==="auxclick"&&t.button!==1)return;const e=t.composedPath().find(
|
|
1929
|
+
</div>`}updated(){const t=this.#e===null?void 0:$t(this.#e),e=this.#u(t);this.renderRoot.querySelector("slot")?.assign(...e===void 0?[]:[e]),this.#i&&(this.#i=!1,this.renderRoot.querySelector('.browser-tab[aria-selected="true"]')?.focus());const s=t===void 0||t.kind==="new-tab"?"":t.kind==="page"?t.page.url:t.url;if(s===this.#r)return;const n=this.#r===null;this.#r=s,n||this.dispatchEvent(new CustomEvent("dpk-browser-navigate",{detail:{url:s},bubbles:!0,composed:!0}))}#c(t){if(this.#e===null)return;const e=ua(this.#e,t);e!==this.#e&&(this.#e=e,this.#f(),this.renderRoot.querySelector(".browser-page")?.scrollTo?.({top:0}),this.requestUpdate())}#m(t){switch(t.kind){case"reload":this.#v();return;case"address":this.#g(t.input,!1);return;case"back":case"forward":case"new-tab":this.#s=!1,this.#c({kind:t.kind}),this.requestUpdate();return;case"switcher":this.#s=t.open,this.requestUpdate();return;case"activate":this.#s=!1,this.#i=t.focus===!0,this.#c({kind:"activate",id:t.id}),this.requestUpdate();return;case"close-tab":this.#c({kind:"close-tab",id:t.id});return;case"visit":this.#c({kind:"visit",page:t.page});return;default:return}}#g(t,e){const s=this.#h,n=ft(this.#p,t,s),i=n===void 0?{kind:"unreachable",url:ma(t,s)}:{kind:"page",page:{url:n.url}};e!==!1?this.#c({kind:"open-tab",entry:i,background:e.background}):i.kind==="page"?this.#c({kind:"visit",page:i.page}):this.#c({kind:"unreachable",url:i.url})}#v(){if(this.#a!==null||this.#e===null)return;const t=this.#u($t(this.#e));this.#a=setTimeout(()=>{if(this.#a=null,t!==void 0){for(const e of t.querySelectorAll("form"))e.reset();for(const e of t.querySelectorAll("dialog"))e.close();t.scrollTop=0,t.dispatchEvent(new CustomEvent("dpk-reload",{bubbles:!0}))}this.renderRoot.querySelector(".browser-page")?.scrollTo?.({top:0}),this.requestUpdate()},fi),this.requestUpdate()}#f(){this.#a!==null&&(clearTimeout(this.#a),this.#a=null)}#k=t=>{if(t.defaultPrevented||this.#e===null||t.type==="auxclick"&&t.button!==1)return;const e=t.composedPath().find(l=>l instanceof HTMLAnchorElement&&this.contains(l)),s=e?.getAttribute("href");if(e===void 0||s===null||s===void 0||s.startsWith("#"))return;t.preventDefault();const n=t.metaKey||t.ctrlKey||t.button===1,i=e.target==="_blank",d=new URL(s,this.#h).href;this.#g(d,i||n?{background:n}:!1)}}const vs=()=>{customElements.get("dpk-browser")||customElements.define("dpk-browser",ks)},bi=D({en:{listLabel:"Options",empty:"No matches.",selectedCount:a=>`${a} selected`,moveLabel:"to move",toggleLabel:"to toggle",removeChip:a=>`Remove ${a}`},ja:{listLabel:"\u5019\u88DC",empty:"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\u3002",selectedCount:a=>`${a} \u4EF6\u9078\u629E`,moveLabel:"\u3067\u79FB\u52D5",toggleLabel:"\u3067\u5207\u308A\u66FF\u3048",removeChip:a=>`${a} \u3092\u524A\u9664`}}),ki=y({value:$(b(),E(1)),label:$(b(),E(1)),description:u(b()),group:u(b()),avatar:u(b())}),vi=y({options:w(ki),value:u(Jt([b(),w(b())]))}),xs=a=>typeof a=="string"?a===""?[]:[a]:Array.isArray(a)?a.filter(t=>typeof t=="string"&&t!==""):[],ys=a=>{const t=B(vi,a),e=new Set;return{options:t.options.map(n=>{if(e.has(n.value))throw new Error(`duplicate option value: ${n.value}`);return e.add(n.value),{value:n.value,label:n.label,description:n.description??null,group:n.group??null,avatar:n.avatar??null}}),value:t.value===void 0?null:xs(t.value)}},Ut=(a,t)=>{const e=t.trim().toLowerCase();return e===""?a:a.filter(s=>s.label.toLowerCase().includes(e)||(s.description?.toLowerCase().includes(e)??!1))},xi=a=>{const t=[],e=new Map;for(const s of a){let n=e.get(s.group);n===void 0&&(n=[],e.set(s.group,n),t.push(s.group)),n.push(s)}return t.map(s=>({group:s,options:e.get(s)??[]}))},Ft=(a,t)=>t===0?-1:Math.min(Math.max(a,0),t-1),yi=(a,t,e)=>e===0?-1:a<0?t>0?0:e-1:(a+t+e)%e,wi=(a,t,e)=>e?a.includes(t)?a.filter(s=>s!==t):[...a,t]:[t],$i=(a,t)=>a.filter(e=>e!==t),Ci=(a,t)=>a.includes(t),Si=(a,t)=>a.length===t.length&&a.every((e,s)=>e===t[s]),Ei=(a,t)=>t.flatMap(e=>{const s=a.find(n=>n.value===e);return s?[s]:[]}),zi=(a,t)=>{const e=t[0];return e===void 0?null:a.find(s=>s.value===e)?.label??null},ws=a=>{const t=a.trim().split(/\s+/).filter(Boolean),e=t[0]?.[0]??"",s=t.length>1?t[t.length-1]?.[0]??"":"";return`${e}${s}`.toUpperCase()},$s=["blue","green","amber","violet","accent","danger"],Cs=a=>{let t=0;for(let e=0;e<a.length;e+=1)t=t*31+a.charCodeAt(e)|0;return $s[Math.abs(t)%$s.length]??"blue"};let Ti=0;const Ai=".combo-control, .combo-listbox";class Ss extends z{static{this.styles=[M,T`
|
|
1930
1930
|
:host {
|
|
1931
1931
|
display: block;
|
|
1932
1932
|
}
|
|
@@ -2245,11 +2245,11 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
2245
2245
|
color: var(--dpk-danger);
|
|
2246
2246
|
font-size: 12px;
|
|
2247
2247
|
}
|
|
2248
|
-
`]}static{this.properties={label:{type:String},placeholder:{type:String},multiple:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}}}#n=`dpk-combobox-${++Ti}`;#t=new R(this);#e=new bt(this);#s=null;#a=[];#i=[];#r=null;#o=!1;#l=null;#d=-1;constructor(){super(),this.label=null,this.placeholder=null,this.multiple=!1,this.name=null,new Ws(this,{open:()=>this.#o,closesOn:t=>!t.some(e=>e instanceof Element&&e.matches(Ai)),ownsEscape:()=>this.#o,dismiss:()=>this.#b()})}connectedCallback(){super.connectedCallback(),this.#s=N(this,ys,t=>{t.ok?(this.#a=t.value.options,this.#r=null,t.value.value!==null&&(this.#i=t.value.value)):(this.#a=[],this.#r=t.error),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.#s?.(),this.#s=null}get value(){return this.multiple?this.#i:this.#i[0]??""}set value(t){this.#i=xs(t),this.requestUpdate()}render(){const t=this.#p;if(this.#r!==null)return r`<p class="error">${this.#r}</p>`;const e=this.#l??"",s=Ut(this.#a,e),n=Ft(this.#d,s.length),i=this.multiple?Ei(this.#a,this.#i):[],
|
|
2248
|
+
`]}static{this.properties={label:{type:String},placeholder:{type:String},multiple:{type:Boolean,reflect:!0},name:{type:String,reflect:!0}}}#n=`dpk-combobox-${++Ti}`;#t=new R(this);#e=new bt(this);#s=null;#a=[];#i=[];#r=null;#o=!1;#l=null;#d=-1;constructor(){super(),this.label=null,this.placeholder=null,this.multiple=!1,this.name=null,new Ws(this,{open:()=>this.#o,closesOn:t=>!t.some(e=>e instanceof Element&&e.matches(Ai)),ownsEscape:()=>this.#o,dismiss:()=>this.#b()})}connectedCallback(){super.connectedCallback(),this.#s=N(this,ys,t=>{t.ok?(this.#a=t.value.options,this.#r=null,t.value.value!==null&&(this.#i=t.value.value)):(this.#a=[],this.#r=t.error),this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.#s?.(),this.#s=null}get value(){return this.multiple?this.#i:this.#i[0]??""}set value(t){this.#i=xs(t),this.requestUpdate()}render(){const t=this.#p;if(this.#r!==null)return r`<p class="error">${this.#r}</p>`;const e=this.#l??"",s=Ut(this.#a,e),n=Ft(this.#d,s.length),i=this.multiple?Ei(this.#a,this.#i):[],d=this.multiple?null:zi(this.#a,this.#i),l=this.multiple?this.#i.length===0:d===null,o=this.#l??(this.multiple?"":d??"");return r`
|
|
2249
2249
|
<div class="field">
|
|
2250
2250
|
${this.label?r`<label class="field-label" id=${this.#h}>${this.label}</label>`:h}
|
|
2251
2251
|
<div class="combo-control">
|
|
2252
|
-
${this.multiple?F(i,
|
|
2252
|
+
${this.multiple?F(i,m=>m.value,m=>this.#v(m,t)):h}
|
|
2253
2253
|
<input
|
|
2254
2254
|
class="input"
|
|
2255
2255
|
type="text"
|
|
@@ -2262,7 +2262,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
2262
2262
|
aria-controls=${this.#u}
|
|
2263
2263
|
aria-labelledby=${this.label?this.#h:h}
|
|
2264
2264
|
aria-activedescendant=${n>=0?this.#c(s[n]?.value??""):h}
|
|
2265
|
-
placeholder=${
|
|
2265
|
+
placeholder=${l?this.placeholder??"":""}
|
|
2266
2266
|
.value=${o}
|
|
2267
2267
|
@focus=${this.#f}
|
|
2268
2268
|
@click=${this.#f}
|
|
@@ -2275,7 +2275,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
2275
2275
|
tabindex="-1"
|
|
2276
2276
|
aria-hidden="true"
|
|
2277
2277
|
data-open=${this.#o?"true":"false"}
|
|
2278
|
-
@mousedown=${
|
|
2278
|
+
@mousedown=${m=>m.preventDefault()}
|
|
2279
2279
|
@click=${this.#S}
|
|
2280
2280
|
>
|
|
2281
2281
|
${Gs()}
|
|
@@ -2295,7 +2295,7 @@ ${oe.cssText}`,document.head.append(t)},Za=D({en:{aria:"Line chart",empty:"No da
|
|
|
2295
2295
|
<div class="options">
|
|
2296
2296
|
${t.length===0?r`<p class="empty">${s.empty}</p>`:n.map(i=>r`
|
|
2297
2297
|
${i.group!==null?r`<div class="group-heading">${i.group}</div>`:h}
|
|
2298
|
-
${F(i.options,
|
|
2298
|
+
${F(i.options,d=>d.value,d=>this.#g(d,t.indexOf(d)===e))}
|
|
2299
2299
|
`)}
|
|
2300
2300
|
</div>
|
|
2301
2301
|
<div class="footer">
|