@creaditor/web-starterkit 1.0.39 → 1.0.40
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/112.creaditor.bundle.js.gz +0 -0
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1204.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/1317.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/1396.creaditor.bundle.js.gz +0 -0
- package/dist/1403.creaditor.bundle.js.gz +0 -0
- package/dist/1456.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/168.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/175.creaditor.bundle.js.gz +0 -0
- package/dist/1972.creaditor.bundle.js.gz +0 -0
- package/dist/2001.creaditor.bundle.js +16 -16
- package/dist/2001.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2112.creaditor.bundle.js.gz +0 -0
- package/dist/2154.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2298.creaditor.bundle.js.gz +0 -0
- package/dist/235.creaditor.bundle.js.gz +0 -0
- package/dist/2350.creaditor.bundle.js.gz +0 -0
- package/dist/2377.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2397.creaditor.bundle.js.gz +0 -0
- package/dist/2409.creaditor.bundle.js.gz +0 -0
- package/dist/2547.creaditor.bundle.js.gz +0 -0
- package/dist/2550.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/2682.creaditor.bundle.js +195 -0
- package/dist/{7051.creaditor.bundle.js.LICENSE.txt → 2682.creaditor.bundle.js.LICENSE.txt} +0 -6
- package/dist/{7051.creaditor.bundle.js.LICENSE.txt.gz → 2682.creaditor.bundle.js.LICENSE.txt.gz} +0 -0
- package/dist/2682.creaditor.bundle.js.gz +0 -0
- package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2706.creaditor.bundle.js.gz +0 -0
- package/dist/271.creaditor.bundle.js.gz +0 -0
- package/dist/2717.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2773.creaditor.bundle.js.gz +0 -0
- package/dist/2833.creaditor.bundle.js.gz +0 -0
- package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2837.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/2963.creaditor.bundle.js.gz +0 -0
- package/dist/3105.creaditor.bundle.js.gz +0 -0
- package/dist/3233.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/3545.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3606.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/380.creaditor.bundle.js.gz +0 -0
- package/dist/3827.creaditor.bundle.js.gz +0 -0
- package/dist/3847.creaditor.bundle.js.gz +0 -0
- package/dist/3875.creaditor.bundle.js.gz +0 -0
- package/dist/3971.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/407.creaditor.bundle.js.gz +0 -0
- package/dist/4074.creaditor.bundle.js.gz +0 -0
- package/dist/4100.creaditor.bundle.js.gz +0 -0
- package/dist/4109.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/4161.creaditor.bundle.js.gz +0 -0
- package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/4186.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4413.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4615.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/467.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +235 -198
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/4947.creaditor.bundle.js.gz +0 -0
- package/dist/4987.creaditor.bundle.js.gz +0 -0
- package/dist/4988.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5133.creaditor.bundle.js.gz +0 -0
- package/dist/5156.creaditor.bundle.js +1 -1
- package/dist/5156.creaditor.bundle.js.gz +0 -0
- package/dist/5284.creaditor.bundle.js.gz +0 -0
- package/dist/5379.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5411.creaditor.bundle.js.gz +0 -0
- package/dist/5501.creaditor.bundle.js.gz +0 -0
- package/dist/5530.creaditor.bundle.js.gz +0 -0
- package/dist/5666.creaditor.bundle.js.gz +0 -0
- package/dist/567.creaditor.bundle.js.gz +0 -0
- package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/5713.creaditor.bundle.js.gz +0 -0
- package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/574.creaditor.bundle.js.gz +0 -0
- package/dist/578.creaditor.bundle.js.gz +0 -0
- package/dist/5791.creaditor.bundle.js.gz +0 -0
- package/dist/5839.creaditor.bundle.js.gz +0 -0
- package/dist/5849.creaditor.bundle.js.gz +0 -0
- package/dist/5850.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/59.creaditor.bundle.js.gz +0 -0
- package/dist/5909.creaditor.bundle.js +19 -19
- package/dist/5909.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6036.creaditor.bundle.js.gz +0 -0
- package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/6216.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6442.creaditor.bundle.js.gz +0 -0
- package/dist/6496.creaditor.bundle.js.gz +0 -0
- package/dist/653.creaditor.bundle.js.gz +0 -0
- package/dist/6751.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/6937.creaditor.bundle.js.gz +0 -0
- package/dist/7055.creaditor.bundle.js.gz +0 -0
- package/dist/715.creaditor.bundle.js +4 -4
- package/dist/715.creaditor.bundle.js.gz +0 -0
- package/dist/7155.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +32 -30
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/7255.creaditor.bundle.js.gz +0 -0
- package/dist/738.creaditor.bundle.js.gz +0 -0
- package/dist/7380.creaditor.bundle.js.gz +0 -0
- package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7463.creaditor.bundle.js.gz +0 -0
- package/dist/7466.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7523.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7654.creaditor.bundle.js.gz +0 -0
- package/dist/767.creaditor.bundle.js +26 -70
- package/dist/767.creaditor.bundle.js.gz +0 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7789.creaditor.bundle.js.gz +0 -0
- package/dist/7838.creaditor.bundle.js.gz +0 -0
- package/dist/7918.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/7997.creaditor.bundle.js.gz +0 -0
- package/dist/8042.creaditor.bundle.js.gz +0 -0
- package/dist/8064.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8173.creaditor.bundle.js.gz +0 -0
- package/dist/8196.creaditor.bundle.js.gz +0 -0
- package/dist/823.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8251.creaditor.bundle.js.gz +0 -0
- package/dist/8299.creaditor.bundle.js.gz +0 -0
- package/dist/8315.creaditor.bundle.js.gz +0 -0
- package/dist/8443.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8533.creaditor.bundle.js.gz +0 -0
- package/dist/8547.creaditor.bundle.js.gz +0 -0
- package/dist/8570.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +36 -37
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/8854.creaditor.bundle.js.gz +0 -0
- package/dist/8878.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/8921.creaditor.bundle.js.gz +0 -0
- package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/898.creaditor.bundle.js.gz +0 -0
- package/dist/8983.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/9158.creaditor.bundle.js.gz +0 -0
- package/dist/9250.creaditor.bundle.js.gz +0 -0
- package/dist/9386.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9453.creaditor.bundle.js.gz +0 -0
- package/dist/9570.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/975.creaditor.bundle.js.gz +0 -0
- package/dist/976.creaditor.bundle.js.gz +0 -0
- package/dist/9986.creaditor.bundle.js.gz +0 -0
- package/dist/9990.creaditor.bundle.js.gz +0 -0
- package/dist/9994.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +173 -173
- package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/index.html.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/dist/workbox-f3063069.js.gz +0 -0
- package/package.json +2 -2
- package/dist/1260.creaditor.bundle.js +0 -459
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1393.creaditor.bundle.js +0 -1
- package/dist/1393.creaditor.bundle.js.gz +0 -0
- package/dist/1452.creaditor.bundle.js +0 -23
- package/dist/1452.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +0 -1216
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/1756.creaditor.bundle.js +0 -1
- package/dist/1756.creaditor.bundle.js.gz +0 -0
- package/dist/1936.creaditor.bundle.js +0 -177
- package/dist/1936.creaditor.bundle.js.LICENSE.txt +0 -29
- package/dist/1936.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/1936.creaditor.bundle.js.gz +0 -0
- package/dist/2438.creaditor.bundle.js +0 -67
- package/dist/2438.creaditor.bundle.js.gz +0 -0
- package/dist/2834.creaditor.bundle.js +0 -14
- package/dist/2834.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/2834.creaditor.bundle.js.gz +0 -0
- package/dist/307.creaditor.bundle.js +0 -23
- package/dist/307.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +0 -194
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/365.creaditor.bundle.js +0 -26
- package/dist/365.creaditor.bundle.js.gz +0 -0
- package/dist/3778.creaditor.bundle.js +0 -1
- package/dist/3778.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +0 -30
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4217.creaditor.bundle.js +0 -105
- package/dist/4217.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/4569.creaditor.bundle.js +0 -887
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +0 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +0 -1316
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +0 -157
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5428.creaditor.bundle.js +0 -23
- package/dist/5428.creaditor.bundle.js.gz +0 -0
- package/dist/5813.creaditor.bundle.js +0 -613
- package/dist/5813.creaditor.bundle.js.LICENSE.txt +0 -10
- package/dist/5813.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/5813.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +0 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/6459.creaditor.bundle.js +0 -23
- package/dist/6459.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +0 -151
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/7051.creaditor.bundle.js +0 -162
- package/dist/7051.creaditor.bundle.js.gz +0 -0
- package/dist/763.creaditor.bundle.js +0 -1
- package/dist/763.creaditor.bundle.js.gz +0 -0
- package/dist/7759.creaditor.bundle.js +0 -25
- package/dist/7759.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js.LICENSE.txt +0 -5
- package/dist/8303.creaditor.bundle.js +0 -57
- package/dist/8303.creaditor.bundle.js.LICENSE.txt +0 -10
- package/dist/8303.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8303.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +0 -32
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8386.creaditor.bundle.js +0 -1420
- package/dist/8386.creaditor.bundle.js.gz +0 -0
- package/dist/84702e107adede1a967468c78921d455.mp4 +0 -0
- package/dist/8478.creaditor.bundle.js +0 -1
- package/dist/8478.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +0 -24
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/88.creaditor.bundle.js +0 -1
- package/dist/88.creaditor.bundle.js.gz +0 -0
- package/dist/8876.creaditor.bundle.js +0 -25
- package/dist/8876.creaditor.bundle.js.LICENSE.txt +0 -32
- package/dist/8876.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8876.creaditor.bundle.js.gz +0 -0
- package/dist/9089.creaditor.bundle.js +0 -21
- package/dist/9089.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +0 -24
- package/dist/9162.creaditor.bundle.js.gz +0 -0
- package/dist/9184.creaditor.bundle.js +0 -23
- package/dist/9184.creaditor.bundle.js.gz +0 -0
- package/dist/9193.creaditor.bundle.js +0 -1
- package/dist/9193.creaditor.bundle.js.gz +0 -0
- package/dist/9338.creaditor.bundle.js +0 -1
- package/dist/9338.creaditor.bundle.js.gz +0 -0
- package/dist/951.creaditor.bundle.js +0 -1
- package/dist/951.creaditor.bundle.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5909],{65909(e,t,i){i.r(t),i.d(t,{NextButton:()=>g,PUBLISH_ERROR_EVENT:()=>f,PUBLISH_EVENT:()=>u});var
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5909],{65909(e,t,i){i.r(t),i.d(t,{NextButton:()=>g,PUBLISH_ERROR_EVENT:()=>f,PUBLISH_EVENT:()=>u});var o=i(59929),s=i(86319),r=i(93432),n=i(90090),a=i(86959),l=i(15604);const c=`${(0,a.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/seo-generate`;const d=o.qy`
|
|
2
2
|
<svg viewBox="0 0 24 24" fill="currentColor" width="16" height="16" aria-hidden="true">
|
|
3
3
|
<path
|
|
4
4
|
d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25L19 9zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12l-5.5-2.5zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25L19 15z"
|
|
5
5
|
/>
|
|
6
6
|
</svg>
|
|
7
|
-
`;class h extends
|
|
7
|
+
`;class h extends o.WF{constructor(){super(),this.resolver=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.onCancel=()=>{this.loading||(this.settle(null),this.dismiss())},this.onKeywordKeydown=e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),this.commitDraftKeyword()):"Backspace"===e.key&&""===this.keywordDraft&&this.keywordList.length&&(this.keywordList=this.keywordList.slice(0,-1))},this.generateField=async e=>{if(this.loading||this.generatingField)return;const t=function(){const e=document.getElementById("main-page-wrapper");return(e?.innerText||"").trim()}();if(t){this.generatingField=e;try{const i="rtl"===this.direction?"he":"en",o=await this.requestSeo(e,t,i);if("keywords"===e){const e=(Array.isArray(o)?o:String(o).split(",")).map(e=>e.trim()).filter(Boolean),t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t}else"title"===e?this.title=String(o).slice(0,100):this.description=String(o).slice(0,255)}catch(e){console.error("[seo-generate] failed:",e),this.snackbar(this.t("seo_generate_failed","Couldn't generate. Please try again."))}finally{this.generatingField=""}}else this.snackbar(this.t("seo_generate_empty","Add some content to the page first."))},this.onPublish=()=>{this.loading||(this.commitDraftKeyword(),this.loading=!0,this.settle({seo:{title:this.title.trim(),description:this.description.trim(),keywords:[...this.keywordList]},busy:e=>{this.isConnected&&(this.loading=e)},done:this.dismiss}))},this.loading=!1,this.title="",this.description="",this.keywordList=[],this.keywordDraft="",this.keywordsFocused=!1,this.generatingField=""}static open(){const e=document.createElement("cdtr-publish-seo"),t=s.M.get("app","seo")||{};return e.title=t.title||"",e.description=t.description||"",e.keywordList=(Array.isArray(t.keywords)?t.keywords:String(t.keywords||"").split(",")).map(e=>String(e).trim()).filter(Boolean),document.body.appendChild(e),e.waitForChoice()}waitForChoice(){return new Promise(e=>{this.resolver=e})}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}settle(e){this.resolver&&(this.resolver(e),this.resolver=null)}commitDraftKeyword(){const e=this.keywordDraft.split(",").map(e=>e.trim()).filter(Boolean);if(!e.length)return;const t=[...this.keywordList];for(const i of e)t.includes(i)||t.push(i);this.keywordList=t,this.keywordDraft=""}removeKeyword(e){this.keywordList=this.keywordList.filter((t,i)=>i!==e)}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}async requestSeo(e,t,i){const o=async o=>{const s=await async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=l.Ay;if("function"==typeof t.studioTokenProvider)try{const i=await t.studioTokenProvider({forceRefresh:e});if("string"==typeof i&&i.length>0)return i}catch{}return"string"==typeof t.studioToken&&t.studioToken.length>0?t.studioToken:null}(o),r={"Content-Type":"application/json",Accept:"application/json"};return s&&(r.Authorization=`Bearer ${s}`),fetch(c,{method:"POST",headers:r,body:JSON.stringify({content:t,field:e,language:i})})};let s=await o(!1);if(401===s.status&&(s=await o(!0)),!s.ok)throw new Error(`HTTP ${s.status}`);const r=await s.json();if(!r.ok||void 0===r.value)throw new Error("bad response");return r.value}magicButton(e){const t=this.generatingField===e;return o.qy`
|
|
8
8
|
<button
|
|
9
9
|
class="magic"
|
|
10
10
|
type="button"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
?disabled=${this.loading||!!this.generatingField}
|
|
14
14
|
@click=${()=>this.generateField(e)}
|
|
15
15
|
>
|
|
16
|
-
${t?
|
|
16
|
+
${t?o.qy`<span class="mini-spinner"></span>`:d}
|
|
17
17
|
</button>
|
|
18
|
-
`}render(){const e=this.direction;return
|
|
18
|
+
`}render(){const e=this.direction;return o.qy`
|
|
19
19
|
<div class="backdrop" @click=${this.onCancel}></div>
|
|
20
20
|
<div class="card" dir=${e}>
|
|
21
21
|
<h2 class="heading">${this.t("ready_to_publish","Ready to publish")}</h2>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
class="chips ${this.keywordsFocused?"focused":""}"
|
|
64
64
|
@click=${e=>{const t=e.currentTarget.querySelector("input");t?.focus()}}
|
|
65
65
|
>
|
|
66
|
-
${this.keywordList.map((e,t)=>
|
|
66
|
+
${this.keywordList.map((e,t)=>o.qy`
|
|
67
67
|
<span class="chip">
|
|
68
68
|
${e}
|
|
69
69
|
<button
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
|
|
91
91
|
<div class="actions">
|
|
92
92
|
<button class="publish" ?disabled=${this.loading} @click=${this.onPublish}>
|
|
93
|
-
${this.loading?
|
|
93
|
+
${this.loading?o.qy`<span class="spinner"></span>`:this.t("publish","Publish")}
|
|
94
94
|
</button>
|
|
95
95
|
<button class="cancel" ?disabled=${this.loading} @click=${this.onCancel}>
|
|
96
96
|
${this.t("cancel","Cancel")}
|
|
97
97
|
</button>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
|
-
`}}h.styles=
|
|
100
|
+
`}}h.styles=o.AH`
|
|
101
101
|
:host {
|
|
102
102
|
position: fixed;
|
|
103
103
|
inset: 0;
|
|
@@ -343,20 +343,20 @@
|
|
|
343
343
|
@keyframes spin {
|
|
344
344
|
to { transform: rotate(360deg); }
|
|
345
345
|
}
|
|
346
|
-
`,h.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",h);class p extends
|
|
346
|
+
`,h.properties={loading:{type:Boolean},title:{type:String},description:{type:String},keywordList:{type:Array},keywordDraft:{type:String},keywordsFocused:{type:Boolean},generatingField:{type:String}},customElements.define("cdtr-publish-seo",h);class p extends o.WF{constructor(){super(),this.raf=0,this.dismissTimer=null,this.onKeyDown=e=>{"Escape"===e.key&&this.dismiss()},this.dismiss=()=>{this.isConnected&&this.remove()},this.copyLink=async()=>{if(this.url)try{await navigator.clipboard.writeText(this.url),this.copied=!0,setTimeout(()=>this.copied=!1,2e3)}catch{}},this.message="",this.sub="",this.url="",this.seoTitle="",this.seoDescription="",this.copied=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onKeyDown)}firstUpdated(){this.launchConfetti(),this.dismissTimer=setTimeout(()=>this.dismiss(),6500)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),this.dismissTimer&&clearTimeout(this.dismissTimer),document.removeEventListener("keydown",this.onKeyDown)}t(e,t){return s.M.get("lang",e)||t}get direction(){const e=s.M.get("theme");return e?.direction||"rtl"}get host(){return this.url?this.url.replace(/^https?:\/\//,"").replace(/\/+$/,""):""}launchConfetti(){const e=this.renderRoot.querySelector("canvas");if(!e)return;const t=e.getContext("2d");if(!t)return;const i=window.devicePixelRatio||1,o=window.innerWidth,s=window.innerHeight;e.width=o*i,e.height=s*i,t.scale(i,i);const r=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],n=o/2,a=.42*s,l=Math.min(220,Math.round(o/6)),c=Array.from({length:l},(e,t)=>{const i=2*Math.PI*t/l+t%3*.4,o=4+t%9;return{x:n,y:a,vx:Math.cos(i)*o,vy:Math.sin(i)*o-3,size:5+t%5,color:r[t%r.length],rot:t,vrot:(t%2?1:-1)*(.1+t%5*.03),life:1}}),d=performance.now(),h=e=>{const i=e-d;t.clearRect(0,0,o,s);let r=!1;for(const e of c)e.vy+=.16,e.x+=e.vx,e.y+=e.vy,e.rot+=e.vrot,i>2600*.55&&(e.life=Math.max(0,e.life-.02)),e.life>0&&e.y<s+40&&(r=!0),t.save(),t.globalAlpha=e.life,t.translate(e.x,e.y),t.rotate(e.rot),t.fillStyle=e.color,t.fillRect(-e.size/2,-e.size/2,e.size,.6*e.size),t.restore();r&&i<3e3?this.raf=requestAnimationFrame(h):t.clearRect(0,0,o,s)};this.raf=requestAnimationFrame(h)}renderPreview(){const e=this.host;if(!e)return o.s6;const t=(this.seoTitle||"").trim()||(this.seoDescription?"":e),i=(this.seoDescription||"").trim(),s=(t||e).charAt(0);return o.qy`
|
|
347
347
|
<div class="preview">
|
|
348
348
|
<p class="preview-caption">${this.t("search_preview_label","How your page will look on Google")}</p>
|
|
349
349
|
<div class="result-head">
|
|
350
|
-
<span class="favicon">${
|
|
350
|
+
<span class="favicon">${s}</span>
|
|
351
351
|
<div class="result-url">
|
|
352
352
|
<div class="result-host">${e.split("/")[0]}</div>
|
|
353
353
|
<div class="result-crumb">${e}</div>
|
|
354
354
|
</div>
|
|
355
355
|
</div>
|
|
356
|
-
${t?
|
|
357
|
-
${i?
|
|
356
|
+
${t?o.qy`<p class="result-title">${t}</p>`:o.s6}
|
|
357
|
+
${i?o.qy`<p class="result-desc">${i}</p>`:o.s6}
|
|
358
358
|
</div>
|
|
359
|
-
`}render(){const e=this.direction,t=this.copied?
|
|
359
|
+
`}render(){const e=this.direction,t=this.copied?o.qy`<svg viewBox="0 0 24 24" fill="none"><path d="M5 13l4 4L19 7" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" /></svg>`:o.qy`<svg viewBox="0 0 24 24" fill="none"><rect x="9" y="9" width="11" height="11" rx="2" stroke="currentColor" stroke-width="2" /><path d="M5 15V5a2 2 0 0 1 2-2h10" stroke="currentColor" stroke-width="2" stroke-linecap="round" /></svg>`;return o.qy`
|
|
360
360
|
<canvas @click=${this.dismiss}></canvas>
|
|
361
361
|
<div class="card" dir=${e}>
|
|
362
362
|
<button
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
|
|
379
379
|
${this.renderPreview()}
|
|
380
380
|
|
|
381
|
-
${this.url?
|
|
381
|
+
${this.url?o.qy`
|
|
382
382
|
<div class="actions">
|
|
383
383
|
<a class="view" href=${this.url} target="_blank" rel="noopener">
|
|
384
384
|
<svg viewBox="0 0 24 24" fill="none"><path d="M14 4h6v6M20 4l-9 9M18 13v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
|
@@ -389,9 +389,9 @@
|
|
|
389
389
|
${this.copied?this.t("link_copied","Link copied"):this.t("copy_link","Copy link")}
|
|
390
390
|
</button>
|
|
391
391
|
</div>
|
|
392
|
-
`:
|
|
392
|
+
`:o.s6}
|
|
393
393
|
</div>
|
|
394
|
-
`}}p.styles=
|
|
394
|
+
`}}p.styles=o.AH`
|
|
395
395
|
:host {
|
|
396
396
|
position: fixed;
|
|
397
397
|
inset: 0;
|
|
@@ -624,21 +624,21 @@
|
|
|
624
624
|
width: 15px;
|
|
625
625
|
height: 15px;
|
|
626
626
|
}
|
|
627
|
-
`,p.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",p);const u="creaditor:publish",f="creaditor:publish-error";class g extends
|
|
627
|
+
`,p.properties={message:{type:String},sub:{type:String},url:{type:String},seoTitle:{type:String},seoDescription:{type:String},copied:{type:Boolean}},customElements.define("cdtr-publish-success",p);const u="creaditor:publish",f="creaditor:publish-error";class g extends o.WF{constructor(){super(),this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),this.onNextStep||(this.onNextStep=s.M.get("config","onNextStep")),this.onPublish||(this.onPublish=s.M.get("config","onPublish")),this.channel||(this.channel=s.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async handleClick(){if(this.isLocked||this.isLoading)return;const e=!!s.M.get("config","access"),t="web"===this.channel,i=e&&t;let o=null;if(t&&(o=await h.open(),!o))return;const a=o?o.seo:null;this.isLoading=!0,this.isLocked=!0;const l=Date.now();this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{if(t&&o){let e=!1;try{i&&a&&(await(0,n.YE)({seo:a}),await(0,n.bK)({})),"function"==typeof this.onPublish?e=await this.runHostPublish(this.onPublish,a,i,o):"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:r.FE,toJSON:r.U2,seo:a??void 0})}finally{o.done()}return void(e||(this.emitPublished(i,a),this.celebratePublish(a)))}const e=s.M.get("config","editor","props","onSave"),l=Date.now();"function"==typeof e&&await e({transactions:[],toJson:r.U2,toJSON:r.U2,toHTML:r.FE});const c=Date.now()-l;c<3e3&&await new Promise(e=>setTimeout(e,3e3-c)),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:r.FE,toJSON:r.U2}),this.emitPublished(i,a)}catch(e){console.error("Error in publish/onNextStep:",e),this.emitPublishError(i,a,e),this.snackbar(s.M.get("lang","publishError")||"Publish failed")}finally{const e=Date.now()-l;e<400&&await new Promise(t=>setTimeout(t,400-e)),this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}runHostPublish(e,t,i,o){return new Promise(a=>{let l=!1;const c=(e,r,n)=>{l||(l=!0,clearTimeout(d),o.done(),e?(this.celebratePublish(t),this.emitPublished(i,t)):(this.snackbar(n||s.M.get("lang","publishError")||"Publish failed"),this.emitPublishError(i,t,r)),a(!0))},d=setTimeout(()=>{l||(console.warn("config.onPublish never signalled completion — finishing the publish without it. Call success() or error() (or return a promise) so the modal can come down."),l=!0,o.done(),a(!1))},6e4),h={title:t.title,description:t.description,keywords:t.keywords},p={loading:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return o.busy(e)},success:()=>c(!0),confetti:()=>c(!0),error:e=>c(!1,new Error(e||"host publish failed"),e),commands:{patchSite:e=>(0,n.YE)(e??{}),publishSite:e=>(0,n.bK)(e??{}),toHTML:r.FE,toJSON:r.U2}};let u;try{u=e(h,p)}catch(e){return console.error("Error in config.onPublish:",e),void c(!1,e)}u&&"function"==typeof u.then&&Promise.resolve(u).then(()=>c(!0),e=>{console.error("Error in config.onPublish:",e),c(!1,e)})})}snackbar(e){const t=s.M.get("commands");t?.snackbar?.(e)}siteUrl(){const e=s.M.get("app","domains"),t=e?.[0]?.name;if(t)return/^https?:\/\//.test(t)?t:`https://${t}`}emitPublished(e,t){const i={channel:this.channel,selfPublish:e,seo:t??void 0,url:this.siteUrl(),toHTML:r.FE,toJSON:r.U2};window.dispatchEvent(new CustomEvent(u,{detail:i}))}emitPublishError(e,t,i){const o={channel:this.channel,selfPublish:e,seo:t??void 0,error:i};window.dispatchEvent(new CustomEvent(f,{detail:o}))}celebratePublish(e){const t=document.createElement("cdtr-publish-success");e&&(t.seoTitle=e.title,t.seoDescription=e.description);const i=this.siteUrl();i&&(t.url=i),document.body.appendChild(t)}render(){const e=!!s.M.get("config","access");if(!(this.onNextStep||"function"==typeof this.onPublish||"web"===this.channel&&e))return null;const t="web"===this.channel?"publish":"next";return o.qy`
|
|
628
628
|
<paper-button
|
|
629
629
|
@click=${this.handleClick}
|
|
630
630
|
class="next-button"
|
|
631
631
|
?disabled=${this.isLocked}
|
|
632
632
|
>
|
|
633
|
-
${this.isLoading?
|
|
633
|
+
${this.isLoading?o.qy`
|
|
634
634
|
<div class="loading-spinner"></div>
|
|
635
|
-
`:
|
|
635
|
+
`:o.qy`
|
|
636
636
|
<div class="button-content ${this.isLoading?"loading":""}">
|
|
637
637
|
<lang-text text=${t}></lang-text>
|
|
638
638
|
</div>
|
|
639
639
|
`}
|
|
640
640
|
</paper-button>
|
|
641
|
-
`}}g.styles=
|
|
641
|
+
`}}g.styles=o.AH`
|
|
642
642
|
:host {
|
|
643
643
|
display: block;
|
|
644
644
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! For license information please see 715.creaditor.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[715],{10715(t,e,s){s.r(e),s.d(e,{UserMenu:()=>$t});const i=globalThis,r=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new WeakMap;let a=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&n.set(e,t))}return t}toString(){return this.cssText}};const l=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,o))(e)})(t):t,{is:h,defineProperty:d,getOwnPropertyDescriptor:c,getOwnPropertyNames:p,getOwnPropertySymbols:u,getPrototypeOf:v}=Object,$=globalThis,f=$.trustedTypes,g=f?f.emptyScript:"",_=$.reactiveElementPolyfillSupport,m=(t,e)=>t,y={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},A=(t,e)=>!h(t,e),b={attribute:!0,type:String,converter:y,reflect:!1,useDefault:!1,hasChanged:A};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=null==i?void 0:i.call(this);null==r||r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=v(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...p(t),...u(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(r)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),r=i.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:y).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var s,i;const r=this.constructor,o=r._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=r.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:y;this._$Em=o;const a=n.fromAttribute(e,t.type);this[o]=a??(null==(i=this._$Ej)?void 0:i.get(o))??a,this._$Em=null}}requestUpdate(t,e,s){var i;if(void 0!==t){const r=this.constructor,o=this[t];if(s??(s=r.getPropertyOptions(t)),!((s.hasChanged??A)(o,e)||s.useDefault&&s.reflect&&o===(null==(i=this._$Ej)?void 0:i.get(t))&&!this.hasAttribute(r._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,s,i){let{useDefault:r,reflect:o,wrapped:n}=s;r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==n||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(s)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[m("elementProperties")]=new Map,E[m("finalized")]=new Map,null==_||_({ReactiveElement:E}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.1.1");const w=globalThis,S=w.trustedTypes,x=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",P=`lit$${Math.random().toFixed(9).slice(2)}$`,U="?"+P,O=`<${U}>`,M=document,H=()=>M.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,k=Array.isArray,N="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,j=/>/g,z=RegExp(`>|${N}(?:([^\\s"'>=/]+)(${N}*=${N}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),D=/'/g,B=/"/g,I=/^(?:script|style|textarea|title)$/i,V=(Z=1,function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];return{_$litType$:Z,strings:t,values:s}}),q=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),J=new WeakMap,K=M.createTreeWalker(M,129);var Z;function F(t,e){if(!k(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}class G{constructor(t,e){let s,{strings:i,_$litType$:r}=t;this.parts=[];let o=0,n=0;const a=i.length-1,l=this.parts,[h,d]=((t,e)=>{const s=t.length-1,i=[];let r,o=2===e?"<svg>":3===e?"<math>":"",n=R;for(let e=0;e<s;e++){const s=t[e];let a,l,h=-1,d=0;for(;d<s.length&&(n.lastIndex=d,l=n.exec(s),null!==l);)d=n.lastIndex,n===R?"!--"===l[1]?n=L:void 0!==l[1]?n=j:void 0!==l[2]?(I.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=z):void 0!==l[3]&&(n=z):n===z?">"===l[0]?(n=r??R,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?z:'"'===l[3]?B:D):n===B||n===D?n=z:n===L||n===j?n=R:(n=z,r=void 0);const c=n===z&&t[e+1].startsWith("/>")?" ":"";o+=n===R?s+O:h>=0?(i.push(a),s.slice(0,h)+C+s.slice(h)+P+c):s+P+(-2===h?e:c)}return[F(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(i,r);if(this.el=G.createElement(h,e),K.currentNode=this.el.content,2===r||3===r){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=K.nextNode())&&l.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=d[n++],i=s.getAttribute(t).split(P),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:r[2],strings:i,ctor:"."===r[1]?et:"?"===r[1]?st:"@"===r[1]?it:tt}),s.removeAttribute(t)}else t.startsWith(P)&&(l.push({type:6,index:o}),s.removeAttribute(t));if(I.test(s.tagName)){const t=s.textContent.split(P),e=t.length-1;if(e>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],H()),K.nextNode(),l.push({type:2,index:++o});s.append(t[e],H())}}}else if(8===s.nodeType)if(s.data===U)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(P,t+1));)l.push({type:7,index:o}),t+=P.length-1}o++}}static createElement(t,e){const s=M.createElement("template");return s.innerHTML=t,s}}function Q(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var r,o;if(e===q)return e;let n=void 0!==i?null==(r=s._$Co)?void 0:r[i]:s._$Cl;const a=T(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==a&&(null==(o=null==n?void 0:n._$AO)||o.call(n,!1),void 0===a?n=void 0:(n=new a(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??(s._$Co=[]))[i]=n:s._$Cl=n),void 0!==n&&(e=Q(t,n._$AS(t,e.values),n,i)),e}class X{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((null==t?void 0:t.creationScope)??M).importNode(e,!0);K.currentNode=i;let r=K.nextNode(),o=0,n=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new Y(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new rt(r,this,t)),this._$AV.push(e),a=s[++n]}o!==(null==a?void 0:a.index)&&(r=K.nextNode(),o++)}return K.currentNode=M,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class Y{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t){t=Q(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),T(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>k(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==W&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=G.createElement(F(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new X(r,this),e=t.u(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=J.get(t.strings);return void 0===e&&J.set(t.strings,e=new G(t)),e}k(t){k(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new Y(this.O(H()),this.O(H()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var s;for(null==(s=this._$AP)||s.call(this,!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=W}_$AI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=this.strings;let o=!1;if(void 0===r)t=Q(this,t,e,0),o=!T(t)||t!==this._$AH&&t!==q,o&&(this._$AH=t);else{const i=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=Q(this,i[s+n],e,n),a===q&&(a=this._$AH[n]),o||(o=!T(a)||a!==this._$AH[n]),a===W?t=W:t!==W&&(t+=(a??"")+r[n+1]),this._$AH[n]=a}o&&!i&&this.j(t)}j(t){t===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===W?void 0:t}}class st extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==W)}}class it extends tt{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t){if((t=Q(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??W)===q)return;const e=this._$AH,s=t===W&&e!==W||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==W&&(e===W||s);s&&this.element.removeEventListener(this.name,this,e),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class rt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Q(this,t)}}const ot=w.litHtmlPolyfillSupport;null==ot||ot(G,Y),(w.litHtmlVersions??(w.litHtmlVersions=[])).push("3.3.1");const nt=globalThis;class at extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=(null==s?void 0:s.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=r=new Y(e.insertBefore(H(),t),t,void 0,s??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return q}}var lt;at._$litElement$=!0,at.finalized=!0,null==(lt=nt.litElementHydrateSupport)||lt.call(nt,{LitElement:at});const ht=nt.litElementPolyfillSupport;null==ht||ht({LitElement:at}),(nt.litElementVersions??(nt.litElementVersions=[])).push("4.2.1");const dt={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:A};function ct(t){return(e,s)=>"object"==typeof s?function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt,e=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)}(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}var pt=Object.defineProperty,ut=Object.getOwnPropertyDescriptor,vt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ut(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&pt(e,s,o),o};customElements.get("cdtr-dropdown")||s.e(7051).then(s.bind(s,97051));let $t=class extends at{constructor(){super(),this.username="",this.avatarUrl="",this.onLogout=()=>{const t=new CustomEvent("logout");this.dispatchEvent(t)},this.logoutText="Logout"}handleLogout(){console.log("Logout clicked"),this.onLogout()}getInitials(){return this.username?this.username.split(" ").map(t=>t.charAt(0)).join("").toUpperCase().slice(0,2):"?"}renderAvatar(){return this.avatarUrl?V`<img src="${this.avatarUrl}" alt="${this.username}" />`:this.username?V`<span class="initials">${this.getInitials()}</span>`:V`
|
|
2
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[715],{14583(t,e,s){s.d(e,{A:()=>K,U:()=>ft,a:()=>l,b:()=>W,i:()=>ht});const i=globalThis,r=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),n=new WeakMap;let a=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&n.set(e,t))}return t}toString(){return this.cssText}};const l=function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];const r=1===t.length?t[0]:s.reduce((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1],t[0]);return new a(r,t,o)},h=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,o))(e)})(t):t,{is:d,defineProperty:c,getOwnPropertyDescriptor:p,getOwnPropertyNames:u,getOwnPropertySymbols:v,getPrototypeOf:$}=Object,g=globalThis,f=g.trustedTypes,_=f?f.emptyScript:"",m=g.reactiveElementPolyfillSupport,y=(t,e)=>t,A={toAttribute(t,e){switch(e){case Boolean:t=t?_:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},b=(t,e)=>!d(t,e),E={attribute:!0,type:String,converter:A,reflect:!1,useDefault:!1,hasChanged:b};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),g.litPropertyMetadata??(g.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E;if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=null==i?void 0:i.call(this);null==r||r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??E}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const t=$(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const t=this.properties,e=[...u(t),...v(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach(t=>t(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(r)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),r=i.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:A).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var s,i;const r=this.constructor,o=r._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=r.getPropertyOptions(o),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:A;this._$Em=o;const a=n.fromAttribute(e,t.type);this[o]=a??(null==(i=this._$Ej)?void 0:i.get(o))??a,this._$Em=null}}requestUpdate(t,e,s){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0;var o;if(void 0!==t){const n=this.constructor;if(!1===i&&(r=this[t]),s??(s=n.getPropertyOptions(t)),!((s.hasChanged??b)(r,e)||s.useDefault&&s.reflect&&r===(null==(o=this._$Ej)?void 0:o.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,s,i){let{useDefault:r,reflect:o,wrapped:n}=s;r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==n||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$EO)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(s)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[y("elementProperties")]=new Map,w[y("finalized")]=new Map,null==m||m({ReactiveElement:w}),(g.reactiveElementVersions??(g.reactiveElementVersions=[])).push("2.1.2");const S=globalThis,x=t=>t,C=S.trustedTypes,P=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,U="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,M="?"+O,H=`<${M}>`,T=document,k=()=>T.createComment(""),N=t=>null===t||"object"!=typeof t&&"function"!=typeof t,R=Array.isArray,L="[ \t\n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,z=/-->/g,D=/>/g,B=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),I=/'/g,V=/"/g,q=/^(?:script|style|textarea|title)$/i,W=(G=1,function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),i=1;i<e;i++)s[i-1]=arguments[i];return{_$litType$:G,strings:t,values:s}}),J=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Z=new WeakMap,F=T.createTreeWalker(T,129);var G;function Q(t,e){if(!R(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==P?P.createHTML(e):e}class X{constructor(t,e){let s,{strings:i,_$litType$:r}=t;this.parts=[];let o=0,n=0;const a=i.length-1,l=this.parts,[h,d]=((t,e)=>{const s=t.length-1,i=[];let r,o=2===e?"<svg>":3===e?"<math>":"",n=j;for(let e=0;e<s;e++){const s=t[e];let a,l,h=-1,d=0;for(;d<s.length&&(n.lastIndex=d,l=n.exec(s),null!==l);)d=n.lastIndex,n===j?"!--"===l[1]?n=z:void 0!==l[1]?n=D:void 0!==l[2]?(q.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=B):void 0!==l[3]&&(n=B):n===B?">"===l[0]?(n=r??j,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?B:'"'===l[3]?V:I):n===V||n===I?n=B:n===z||n===D?n=j:(n=B,r=void 0);const c=n===B&&t[e+1].startsWith("/>")?" ":"";o+=n===j?s+H:h>=0?(i.push(a),s.slice(0,h)+U+s.slice(h)+O+c):s+O+(-2===h?e:c)}return[Q(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]})(i,r);if(this.el=X.createElement(h,e),F.currentNode=this.el.content,2===r||3===r){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=F.nextNode())&&l.length<a;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(U)){const e=d[n++],i=s.getAttribute(t).split(O),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:r[2],strings:i,ctor:"."===r[1]?it:"?"===r[1]?rt:"@"===r[1]?ot:st}),s.removeAttribute(t)}else t.startsWith(O)&&(l.push({type:6,index:o}),s.removeAttribute(t));if(q.test(s.tagName)){const t=s.textContent.split(O),e=t.length-1;if(e>0){s.textContent=C?C.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],k()),F.nextNode(),l.push({type:2,index:++o});s.append(t[e],k())}}}else if(8===s.nodeType)if(s.data===M)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(O,t+1));)l.push({type:7,index:o}),t+=O.length-1}o++}}static createElement(t,e){const s=T.createElement("template");return s.innerHTML=t,s}}function Y(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0;var r,o;if(e===J)return e;let n=void 0!==i?null==(r=s._$Co)?void 0:r[i]:s._$Cl;const a=N(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==a&&(null==(o=null==n?void 0:n._$AO)||o.call(n,!1),void 0===a?n=void 0:(n=new a(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??(s._$Co=[]))[i]=n:s._$Cl=n),void 0!==n&&(e=Y(t,n._$AS(t,e.values),n,i)),e}class tt{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((null==t?void 0:t.creationScope)??T).importNode(e,!0);F.currentNode=i;let r=F.nextNode(),o=0,n=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new et(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new nt(r,this,t)),this._$AV.push(e),a=s[++n]}o!==(null==a?void 0:a.index)&&(r=F.nextNode(),o++)}return F.currentNode=T,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class et{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t){t=Y(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),N(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==J&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>R(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==K&&N(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=X.createElement(Q(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new tt(r,this),e=t.u(this.options);t.p(s),this.T(e),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new X(t)),e}k(t){R(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new et(this.O(k()),this.O(k()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;var s;for(null==(s=this._$AP)||s.call(this,!1,!0,e);t!==this._$AB;){const e=x(t).nextSibling;x(t).remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class st{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=K}_$AI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=this.strings;let o=!1;if(void 0===r)t=Y(this,t,e,0),o=!N(t)||t!==this._$AH&&t!==J,o&&(this._$AH=t);else{const i=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=Y(this,i[s+n],e,n),a===J&&(a=this._$AH[n]),o||(o=!N(a)||a!==this._$AH[n]),a===K?t=K:t!==K&&(t+=(a??"")+r[n+1]),this._$AH[n]=a}o&&!i&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class it extends st{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class rt extends st{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class ot extends st{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t){if((t=Y(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,0)??K)===J)return;const e=this._$AH,s=t===K&&e!==K||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,i=t!==K&&(e===K||s);s&&this.element.removeEventListener(this.name,this,e),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const at=S.litHtmlPolyfillSupport;null==at||at(X,et),(S.litHtmlVersions??(S.litHtmlVersions=[])).push("3.3.2");const lt=globalThis;class ht extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=(null==s?void 0:s.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=r=new et(e.insertBefore(k(),t),t,void 0,s??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return J}}var dt;ht._$litElement$=!0,ht.finalized=!0,null==(dt=lt.litElementHydrateSupport)||dt.call(lt,{LitElement:ht});const ct=lt.litElementPolyfillSupport;null==ct||ct({LitElement:ht}),(lt.litElementVersions??(lt.litElementVersions=[])).push("4.2.2");const pt={attribute:!0,type:String,converter:A,reflect:!1,hasChanged:b};function ut(t){return(e,s)=>"object"==typeof s?function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pt,e=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0;const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t,!0,s)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t,!0,s)}}throw Error("Unsupported decorator location: "+i)}(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}var vt=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,gt=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?$t(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&vt(e,s,o),o};customElements.get("cdtr-dropdown")||s.e(2682).then(s.bind(s,2682));let ft=class extends ht{constructor(){super(),this.username="",this.avatarUrl="",this.onLogout=()=>{const t=new CustomEvent("logout");this.dispatchEvent(t)},this.logoutText="Logout"}handleLogout(){console.log("Logout clicked"),this.onLogout()}getInitials(){return this.username?this.username.split(" ").map(t=>t.charAt(0)).join("").toUpperCase().slice(0,2):"?"}renderAvatar(){return this.avatarUrl?W`<img src="${this.avatarUrl}" alt="${this.username}" />`:this.username?W`<span class="initials">${this.getInitials()}</span>`:W`
|
|
3
3
|
<svg class="default" viewBox="0 0 24 24" fill="currentColor">
|
|
4
4
|
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/>
|
|
5
5
|
</svg>
|
|
6
|
-
`}render(){return
|
|
6
|
+
`}render(){return W`
|
|
7
7
|
<cdtr-dropdown>
|
|
8
8
|
<button
|
|
9
9
|
class="avatar ${!this.avatarUrl&&this.username?"initials":this.avatarUrl||this.username?"":"default"}"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</cdtr-dropdown-item>
|
|
30
30
|
</div>
|
|
31
31
|
</cdtr-dropdown>
|
|
32
|
-
`}}
|
|
32
|
+
`}};ft.styles=l`
|
|
33
33
|
:host {
|
|
34
34
|
display: inline-block;
|
|
35
35
|
}
|
|
@@ -139,4 +139,4 @@
|
|
|
139
139
|
width: 16px;
|
|
140
140
|
height: 16px;
|
|
141
141
|
}
|
|
142
|
-
`,
|
|
142
|
+
`,gt([ut({type:String})],ft.prototype,"username",2),gt([ut({type:String})],ft.prototype,"avatarUrl",2),gt([ut({attribute:!1})],ft.prototype,"onLogout",2),gt([ut({type:String})],ft.prototype,"logoutText",2),ft=gt([(t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("cdtr-user-menu")],ft)},10715(t,e,s){s.r(e),s.d(e,{UserMenu:()=>i.U});var i=s(14583)}}]);
|
|
Binary file
|
|
Binary file
|