@infuro/cms-core 1.0.11 → 1.0.14
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/admin.cjs +1104 -543
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +950 -389
- package/dist/admin.js.map +1 -1
- package/dist/api.cjs +1140 -57
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.cts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +1137 -55
- package/dist/api.js.map +1 -1
- package/dist/auth.cjs +62 -19
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +12 -1
- package/dist/auth.d.ts +12 -1
- package/dist/auth.js +62 -19
- package/dist/auth.js.map +1 -1
- package/dist/{index-C_CZLmHD.d.cts → index-Be8NLxu-.d.cts} +33 -2
- package/dist/{index-DeO4AnAj.d.ts → index-CjBf9dAb.d.ts} +33 -2
- package/dist/index.cjs +3011 -915
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +345 -54
- package/dist/index.d.ts +345 -54
- package/dist/index.js +2812 -740
- package/dist/index.js.map +1 -1
- package/dist/migrations/1774600000000-OrderKindParentOrderNumber.ts +36 -0
- package/dist/migrations/1774800000000-OtpChallengesUserPhone.ts +41 -0
- package/dist/migrations/1774900000000-MessageTemplates.ts +39 -0
- package/package.json +1 -1
package/dist/admin.cjs
CHANGED
|
@@ -384,7 +384,7 @@ var AdminConfigContext = (0, import_react3.createContext)(defaultValue);
|
|
|
384
384
|
var INFURO_FAVICON_BASE64 = "data:image/x-icon;base64,AAABAAMAEBAAAAEAIABoBAAANgAAACAgAAABACAAKBEAAJ4EAAAwMAAAAQAgAGgmAADGFQAAKAAAABAAAAAgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8V////bv///7D////R////0f///7D///9u////FQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wL///9s0qun7q9qYv/DkYv/6tfV///+/v///////////////+7///9r////AgAAAAAAAAAAAAAAAP///wL///+Q/////sqcl/+WOzH/ljsx/5c9M//AiYP/+/j4/////////////////v///5D///8CAAAAAAAAAAD///9s/////v/////Oo5//lz00/5Y7Mf+WOzH/ljsx/7Z3cP/9+/v////////////////+////bAAAAAD///8V////7v///////////v39//Tq6f/QqKP/m0U8/5Y7Mf+WOzH/z6ah/////////////////////+7///8V////bv///////////////////////////////+XOy/+ZQTf/ljsx/59MQ//69fX/////////////////////bv///7D/////////////////////////////////////wYyG/5Y7Mf+WOzH/4MTC/////////////////////7D////R//////////////////7+//79/f/+/f3//v39/+DGw/+WOzH/ljsx/82inf/////////////////////R////0f///////////////9Svq/+mWVH/pllR/6ZZUf+iUUj/ljsx/5Y7Mf/KnJf/////////////////////0f///7D////////////////KnJf/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/062p/////////////////////7D///9u////////////////0amk/6FQSP+hUEj/oVBI/6JRSP+mWVH/plpS/+7g3v////////////////////9u////Ff///+7///////////7+/v/9/Pz/9u7t/8SSjP/Dj4r/9ezr//79/f/////////////////////u////FQAAAAD///9s/////v///////////////8OPif+WOzH/ljsx/7+Jgv/////////////////////+////bAAAAAAAAAAA////Av///5D////+//////////+9hH7/ljsx/5Y7Mf+8g3z////////////////+////kP///wIAAAAAAAAAAAAAAAD///8C////bP///+7/////8OTi/7R0bP+zcmr/8OLh///////////u////bP///wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8V////bv///7D////R////0f///7D///9u////FQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAACAAAABAAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Hf///0n///95////mf///67///+u////mf///3n///9J////Hf///wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8I////Tf///7D////p/////v////////////////////////////////////7////p////sP///03///8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Pfjz8r7HlpH7wY2H/86lof/iysf/9e3s///+/v//////////////////////////////////////////+////77///89////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////Cf///37////z9Ovq/6BORf+WOzH/ljsx/5Y8Mv+hUEf/v4iC/+rY1v/+/f3///////////////////////////////////////////H///99////CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wr///+d/////P/////06+r/oE5F/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/m0Q7/8WTjf/38PD///////////////////////////////////////////z///+d////CgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////nf////3///////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/61mX//w4+L///////////////////////////////////////////3///+d////CQAAAAAAAAAAAAAAAAAAAAAAAAAA////Av///37////8////////////////9Ovq/6BORf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6daUv/v4uD///////////////////////////////////////////z///9+////AgAAAAAAAAAAAAAAAAAAAAD///89////8//////////////////////48fD/rGRc/5pCOf+YPjT/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6xkXf/37+////////////////////////////////////////////P///89AAAAAAAAAAAAAAAA////CP///77////////////////////////////////7+Pf/8eXj/+DGw/++hn//m0U8/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/8GLhf/9/Pz//////////////////////////////////////////77///8IAAAAAAAAAAD///9N////+/////////////////////////////////////////////////7+/v/p1tP/rGRd/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/mkI4/+XPzf//////////////////////////////////////////+////00AAAAA////Av///7D////////////////////////////////////////////////////////////////06+r/r2pi/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/tndw//38+///////////////////////////////////////////sP///wL///8d////6f/////////////////////////////////////////////////////////////////////x5eP/olJJ/5Y7Mf+WOzH/ljsx/5Y7Mf+aQjn/7dza///////////////////////////////////////////p////Hf///0n////+///////////////////////////////////////////////////////////////////////////Ur6v/ljwy/5Y7Mf+WOzH/ljsx/5Y7Mf/Oo5////////////////////////////////////////////7///9J////ef////////////////////////////////////////////////////////////////////////////////fw7/+jVEv/ljsx/5Y7Mf+WOzH/ljsx/7Nxav///////////////////////////////////////////////3n///+Z/////////////////////////////////////////////////////////////////////////////////////7yCfP+WOzH/ljsx/5Y7Mf+WOzH/pllQ//r29f//////////////////////////////////////////mf///67///////////////////////////////////////////79/f/9/Pz//fz8//38/P/9/Pz//fz8//38/P/9/Pz/yZuW/5Y7Mf+WOzH/ljsx/5Y7Mf+gT0b/9evr//////////////////////////////////////////+u////rv/////////////////////////////////////69vb/wo2I/7Z3cf+2d3H/tndx/7Z3cf+2d3H/tndx/7Z3cf+lV0//ljsx/5Y7Mf+WOzH/ljsx/6BORf/06+r//////////////////////////////////////////67///+Z//////////////////////////////////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/oE5F//Tr6v//////////////////////////////////////////mf///3n/////////////////////////////////////9Ovq/6BORf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+lVk7/+fPz//////////////////////////////////////////95////Sf////7////////////////////////////////06+r/oE5F/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/7FuZ////v7//////////////////////////////////////v///0n///8d////6f////////////////////////////////Tr6v+gTkX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/zKCb///////////////////////////////////////////p////Hf///wL///+w////////////////////////////////+PLx/7d4cf+tZl//rWZf/61mX/+tZl//rWZf/61mX/+tZl//rmdg/7Z3cP+2d3H/tndx/7h7df/w4uH//////////////////////////////////////////7D///8CAAAAAP///03////7/////////////////////////////////Pv6//z6+f/8+vn//Pr5//z6+f/z6un/48zJ/+LKx//y5+b//fz8//38/P/9/Pz//fz8///////////////////////////////////////////7////TQAAAAAAAAAA////CP///77/////////////////////////////////////////////////////4MXC/6VXTv+WPDL/ljwy/6JRSP/aubb///7+/////////////////////////////////////////////////////77///8IAAAAAAAAAAAAAAAA////Pf////P///////////////////////////////////////////Xs6/+jU0r/ljsx/5Y7Mf+WOzH/ljsx/59MQv/w5OL////////////////////////////////////////////////z////PQAAAAAAAAAAAAAAAAAAAAD///8C////fv////z/////////////////////////////////////3sK//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/9m5tf///////////////////////////////////////////P///37///8CAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////nf////3////////////////////////////////ZuLX/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/17Sw//////////////////////////////////////3///+d////CQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8K////nf////z//////////////////////////+zc2v+aQzn/ljsx/5Y7Mf+WOzH/ljsx/5pDOf/r2tj////////////////////////////////8////nf///woAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8J////fv////P//////////////////////v39/8eYkv+YPjT/ljsx/5Y7Mf+YPjT/xpSP//79/f//////////////////////////8////37///8JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8C////Pf///77////7/////////////////fv6/+DEwf/Ekoz/wY2H/97Bvv/8+vr/////////////////////+////77///89////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///03///+w////6f////7////////////////////////////////////+////6f///7D///9N////CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wL///8d////Sf///3n///+Z////rv///67///+Z////ef///0n///8d////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAADAAAABgAAAAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8E////DP///xr///80////Rv///1n///9q////gP///4D///9q////Wf///0b///80////Gv///wz///8EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///y7///9g////lP///7v////V////6P////r////8/////P////z////8////+v///+j////V////u////5T///9g////Lv///wgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wf///81////k////8/////v////+v////////////////////////////////////////////////////////////////////r////v////z////5P///81////BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8G////Kv37+3zt3Nrd27y5/Nm6t//fxMH/59LQ//Dk4v/48vH//fv6//////////////////////////////////////////////////////////////////////z////d////fP///yr///8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///xH///9g////wvz5+ffNop3+m0U8/5c+NP+cRz7/pFVN/65oYP+8gnv/0qun/+jU0v/59fT//v7+///////////////////////////////////////////////////////////+////9////8L///9f////EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///4n////m/////fv4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+XPTT/m0Q6/6ZaUf/BjIX/6NXT//z5+f////////////////////////////////////////////////////////////////3////k////if///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8i////pP////f///////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+XPjT/oVFI/8yhnP/x5OP//vz8////////////////////////////////////////////////////////////////9////6T///8i////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yL///+d////8/////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5tEOv+3eHL/48rH//37+/////////////////////////////////////////////////////////////////P///+d////IgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///6T////z//////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+YPjT/qFxT/9y+uv/9+vr////////////////////////////////////////////////////////////////z////pP///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8R////if////f///////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsy/6NUS//Yt7P//Pn4////////////////////////////////////////////////////////////////9////4n///8RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wb///9g////5v////////////////////////////////v4+P/KnZj/mUI4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5c8Mv+pXlb/38PA//38/P///////////////////////////////////////////////////////////////+b///9g////BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yr////C/////f////////////////////////////////38+//dwLz/qF1V/51JP/+bRDv/mD40/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+XPTP/qWBY/+vZ2P///v7///////////////////////////////////////////////////////////3////C////KgAAAAAAAAAAAAAAAAAAAAAAAAAA////B////3z////3///////////////////////////////////////////9+/r/9/Dv/+zc2f/dwLz/x5iT/7BrY/+eS0H/lz0z/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/lzwy/7d6c//06un////////////////////////////////////////////////////////////////3////fP///wcAAAAAAAAAAAAAAAAAAAAA////Nf///93////+//////////////////////////////////////////////////////7+/v/+/v7//fz8//Hm5f/XtLH/s3Fq/5lCOP+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/51JP//Sq6b//Pn5///////////////////////////////////////////////////////////+////3f///zUAAAAAAAAAAAAAAAD///8I////k/////z////////////////////////////////////////////////////////////////////////////////9+/v/8eTj/8aVkP+dRz7/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5c8Mv+vamL/7uDf/////////////////////////////////////////////////////////////////P///5P///8IAAAAAAAAAAD///8u////z/////////////////////////////////////////////////////////////////////////////////////////////////fx8P/ImZP/nUg//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+ZQTj/0qyo//38/P///////////////////////////////////////////////////////////////8////8uAAAAAP///wT///9g////7//////////////////////////////////////////////////////////////////////////////////////////////////////07Or/xJGL/5hAN/+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/rGRd//Tq6P///////////////////////////////////////////////////////////////+////9g////BP///wz///+U////+v////////////////////////////////////////////////////////////////////////////////////////////////////////7/8+jm/7Nya/+WPDP/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/mkQ7/9m3s////v7///////////////////////////////////////////////////////////r///+U////DP///xr///+7/////////////////////////////////////////////////////////////////////////////////////////////////////////////////v7+/+HHxP+hUEf/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljwy/7yBe//69/f///////////////////////////////////////////////////////////////+7////Gv///zT////V//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////bu7f+7gHr/mD40/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6xkXP/u4N/////////////////////////////////////////////////////////////////V////NP///0b////o//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////38/P/XtK//nEY9/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6BNRP/iycb////////////////////////////////////////////////////////////////o////Rv///1n////6///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////o1NL/pVhQ/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5xGPP/Yt7L//v39///////////////////////////////////////////////////////////6////Wf///2r////8///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////06un/sW1m/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5pDOf/PpKD//Pr5///////////////////////////////////////////////////////////8////av///4D////8/////////////////////////////////////////////////////////////v7//fv7//37+v/9+/r//fv6//37+v/9+/r//fv6//37+v/9+/r//fv6//37+v/06un/snBp/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJj/+/j4///////////////////////////////////////////////////////////8////gP///4D////8//////////////////////////////////////////////////////79/f/s3Nr/z6ej/8uemv/Lnpr/y56a/8uemv/Lnpr/y56a/8uemv/Lnpr/y56a/8uemv/GlI//o1VM/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJf/+/j4///////////////////////////////////////////////////////////8////gP///2r////8//////////////////////////////////////////////////////z5+f/Nop3/m0Q7/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lBOP/KnJf/+/j4///////////////////////////////////////////////////////////8////av///1n////6//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5lCOP/KnZj/+/j4///////////////////////////////////////////////////////////6////Wf///0b////o//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5pDOv/Qp6P//Pr6///////////////////////////////////////////////////////////o////Rv///zT////V//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/51IP//bvbr//v7+///////////////////////////////////////////////////////////V////NP///xr///+7//////////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/6RVTf/n0c////////////////////////////////////////////////////////////////+7////Gv///wz///+U////+v////////////////////////////////////////////////v4+P/KnJf/mUE4/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/7FuZ//z6ej///////////////////////////////////////////////////////////r///+U////DP///wT///9g////7/////////////////////////////////////////////////z4+P/LnZj/mkI5/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/ljwy/5Y8Mv+WPDL/mUE3/8mblf/9+/r//////////////////////////////////////////////////////////+////9g////BAAAAAD///8u////z/////////////////////////////////////////////////38/P/iycb/v4iC/7yCfP+8gnz/vIJ8/7yCfP+8gnz/vIJ8/7yCfP+8gnz/vIJ8/7yCfP+8gnz/voR+/8qcl//Lnpr/y56a/8uemv/Lnpr/zqOf//Hl5P///v7//////////////////////////////////////////////////////////8////8uAAAAAAAAAAD///8I////k/////z////////////////////////////////////////////////9/Pz/+vf2//r39v/69/b/+vf2//r39v/69/b/+vf2//j08//07Ov/7+Df/+7f3v/z6+n/+PPy//z6+v/9+/r//fv6//37+v/9+/r//fv7///+/v///////////////////////////////////////////////////////////P///5P///8IAAAAAAAAAAAAAAAA////Nf///93////+/////////////////////////////////////////////////////////////////////////////v7/9u7t/9i3s/++hn//sW1m/7BsZf+7gnv/066q//Ln5v/+/v7////////////////////////////////////////////////////////////////////////////////+////3f///zUAAAAAAAAAAAAAAAAAAAAA////B////3z////3///////////////////////////////////////////////////////////////////////////17Ov/wo6I/55KQf+XPjT/ljsx/5Y7Mf+XPTP/nEY9/7uBe//x5eP////////////////////////////////////////////////////////////////////////////////3////fP///wcAAAAAAAAAAAAAAAAAAAAAAAAAAP///yr////C/////f////////////////////////////////////////////////////////////////37+//UsKz/nUg//5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5tEO//No57/+/j4//////////////////////////////////////////////////////////////////////3////C////KgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wb///9g////5v////////////////////////////////////////////////////////////////bv7/+5fHb/lz0z/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y8Mv+ycGj/8ujm/////////////////////////////////////////////////////////////////////+b///9g////BgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8R////if////f//////////////////////////////////////////////////////////+3e3P+qYlr/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+oXVT/6tnX////////////////////////////////////////////////////////////////9////4n///8RAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///6T////z/////////////////////////////////////////////////////+vZ1/+oXVT/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+nWlL/6dbU///////////////////////////////////////////////////////////z////pP///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///yL///+d////8/////////////////////////////////////////////////Hm5f+wa2T/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5Y7Mf+uaGD/8OPh//////////////////////////////////////////////////////P///+d////IgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8i////pP////f///////////////////////////////////////////r19P/CjYf/mD81/5Y7Mf+WOzH/ljsx/5Y7Mf+WOzH/ljsx/5g/Nf/BjIb/+fTz////////////////////////////////////////////////9////6T///8i////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////GP///4n////m/////f////////////////////////////////7+/v/m0M7/qmFZ/5c9M/+WOzH/ljsx/5Y7Mf+WOzH/lz0z/6leV//lz8z//v7+//////////////////////////////////////3////m////if///xgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///xH///9g////wv////f////+///////////////////////////8+vr/4snG/7d4cf+iUUj/mUA3/5c+NP+gTkT/tXVu/+DFw//8+fn////////////////////////////////+////9////8L///9g////EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8G////Kv///3z////d/////P///////////////////////////v38//Tr6v/kzcv/2726/9m6t//jysf/8uno//78/P////////////////////////////////z////d////fP///yr///8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wf///81////k////8/////v////+v////////////////////////////////////////////////////////////////////r////v////z////5P///81////BwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////CP///y7///9g////lP///7v////V////6P////r////8/////P////z////8////+v///+j////V////u////5T///9g////Lv///wgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8E////DP///xr///80////Rv///1n///9q////gP///4D///9q////Wf///0b///80////Gv///wz///8EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==";
|
|
385
385
|
|
|
386
386
|
// src/lib/cms-version.ts
|
|
387
|
-
var CMS_VERSION = true ? "1.0.
|
|
387
|
+
var CMS_VERSION = true ? "1.0.14" : "0.0.0";
|
|
388
388
|
|
|
389
389
|
// src/components/Admin/Sidebar.tsx
|
|
390
390
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -761,7 +761,13 @@ body{font-family:"Inter",ui-sans-serif,system-ui,sans-serif;font-size:14px}
|
|
|
761
761
|
|
|
762
762
|
// src/admin/pages/AdminLayout.tsx
|
|
763
763
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
764
|
-
var PUBLIC_ADMIN_PATHS = [
|
|
764
|
+
var PUBLIC_ADMIN_PATHS = [
|
|
765
|
+
"/admin/signin",
|
|
766
|
+
"/admin/forgot-password",
|
|
767
|
+
"/admin/reset-password",
|
|
768
|
+
"/admin/invite",
|
|
769
|
+
"/admin/access-denied"
|
|
770
|
+
];
|
|
765
771
|
var AdminStyle = () => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("style", { dangerouslySetInnerHTML: { __html: ADMIN_THEME_CSS } });
|
|
766
772
|
function useAdminViewSettings() {
|
|
767
773
|
(0, import_react6.useEffect)(() => {
|
|
@@ -880,7 +886,7 @@ function AdminLayout({ children, customNavItems = [], customNavSections = [], cu
|
|
|
880
886
|
}),
|
|
881
887
|
[customNavItems, customNavSections, customCrudConfigs, resolvedTheme, themeRegistry, pluginDescriptors, storeEnabled]
|
|
882
888
|
);
|
|
883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AdminConfigContext.Provider, { value: configValue, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AdminLayoutInner, { children }) });
|
|
884
890
|
}
|
|
885
891
|
|
|
886
892
|
// src/admin/AdminShell.tsx
|
|
@@ -5267,7 +5273,7 @@ var SigninPage = () => {
|
|
|
5267
5273
|
const [error, setError] = (0, import_react25.useState)("");
|
|
5268
5274
|
const [loading, setLoading] = (0, import_react25.useState)(false);
|
|
5269
5275
|
const router = (0, import_navigation7.useRouter)();
|
|
5270
|
-
const { status
|
|
5276
|
+
const { status } = (0, import_react26.useSession)();
|
|
5271
5277
|
(0, import_react25.useEffect)(() => {
|
|
5272
5278
|
if (status === "authenticated") {
|
|
5273
5279
|
router.replace("/admin/dashboard");
|
|
@@ -5286,8 +5292,7 @@ var SigninPage = () => {
|
|
|
5286
5292
|
if (result?.error) {
|
|
5287
5293
|
setError("Invalid email or password");
|
|
5288
5294
|
} else {
|
|
5289
|
-
|
|
5290
|
-
router.push("/admin/dashboard");
|
|
5295
|
+
window.location.assign("/admin/dashboard");
|
|
5291
5296
|
}
|
|
5292
5297
|
} catch (error2) {
|
|
5293
5298
|
setError("An error occurred. Please try again.");
|
|
@@ -6104,9 +6109,86 @@ function OrderDetailPage({ orderId }) {
|
|
|
6104
6109
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6105
6110
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Total" }),
|
|
6106
6111
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900", children: formatMoney(Number(order.total), currency) })
|
|
6112
|
+
] }),
|
|
6113
|
+
(order.orderKind || order.parentOrderId != null) && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
6114
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Kind" }),
|
|
6116
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900 capitalize", children: order.orderKind ?? "sale" })
|
|
6117
|
+
] }),
|
|
6118
|
+
order.parentOrderId != null && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0", children: [
|
|
6119
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dt", { className: "text-gray-500", children: "Parent order" }),
|
|
6120
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("dd", { className: "font-medium text-gray-900", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
6121
|
+
import_link10.default,
|
|
6122
|
+
{
|
|
6123
|
+
href: `/admin/orders/${order.parentOrderId}/view`,
|
|
6124
|
+
className: "text-blue-600 hover:underline",
|
|
6125
|
+
children: [
|
|
6126
|
+
"#",
|
|
6127
|
+
order.parentOrderId
|
|
6128
|
+
]
|
|
6129
|
+
}
|
|
6130
|
+
) })
|
|
6131
|
+
] })
|
|
6107
6132
|
] })
|
|
6108
6133
|
] }) })
|
|
6109
6134
|
] }),
|
|
6135
|
+
(() => {
|
|
6136
|
+
const fulfillment = order.metadata?.fulfillment;
|
|
6137
|
+
if (!fulfillment?.status && !fulfillment?.trackingId && !(fulfillment?.events && fulfillment.events.length))
|
|
6138
|
+
return null;
|
|
6139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6140
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Fulfillment" }),
|
|
6141
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm space-y-2", children: [
|
|
6142
|
+
fulfillment.status && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { children: [
|
|
6143
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500", children: "Status: " }),
|
|
6144
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium text-gray-900", children: fulfillment.status })
|
|
6145
|
+
] }),
|
|
6146
|
+
fulfillment.trackingId && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { children: [
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500", children: "Tracking: " }),
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-mono text-gray-900", children: fulfillment.trackingId })
|
|
6149
|
+
] }),
|
|
6150
|
+
fulfillment.events && fulfillment.events.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ul", { className: "mt-3 space-y-2 border-t border-gray-200 pt-3", children: fulfillment.events.map((ev, i) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("li", { className: "text-gray-800", children: [
|
|
6151
|
+
ev.at && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-500 text-xs block", children: ev.at }),
|
|
6152
|
+
ev.label && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "font-medium", children: ev.label }),
|
|
6153
|
+
ev.detail && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-gray-600 ml-1", children: ev.detail })
|
|
6154
|
+
] }, i)) })
|
|
6155
|
+
] })
|
|
6156
|
+
] });
|
|
6157
|
+
})(),
|
|
6158
|
+
(order.orderKind ?? "sale") === "sale" && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6159
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Invoice" }),
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "min-w-0 border border-gray-200 rounded-lg p-4 bg-gray-50/50 text-sm", children: [
|
|
6161
|
+
order.metadata?.invoice?.invoiceNumber && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: "text-gray-700 mb-2", children: [
|
|
6162
|
+
"#",
|
|
6163
|
+
String((order.metadata?.invoice).invoiceNumber)
|
|
6164
|
+
] }),
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6166
|
+
"a",
|
|
6167
|
+
{
|
|
6168
|
+
href: `/api/orders/${order.id}/invoice`,
|
|
6169
|
+
target: "_blank",
|
|
6170
|
+
rel: "noopener noreferrer",
|
|
6171
|
+
className: "text-blue-600 font-medium hover:underline",
|
|
6172
|
+
children: "Download invoice PDF"
|
|
6173
|
+
}
|
|
6174
|
+
)
|
|
6175
|
+
] })
|
|
6176
|
+
] }),
|
|
6177
|
+
(order.relatedOrders ?? []).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Returns & replacements" }),
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "min-w-0 border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
|
|
6180
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(TableRow, { className: "bg-gray-50", children: [
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Number" }),
|
|
6182
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Kind" }),
|
|
6183
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableHead, { className: "font-medium", children: "Status" })
|
|
6184
|
+
] }) }),
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableBody, { children: (order.relatedOrders ?? []).map((r) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(TableRow, { children: [
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_link10.default, { href: `/admin/orders/${r.id}/view`, className: "text-blue-600 hover:underline font-medium", children: r.orderNumber }) }),
|
|
6187
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { className: "capitalize", children: r.orderKind ?? "\u2014" }),
|
|
6188
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TableCell, { className: "capitalize", children: r.status ?? "\u2014" })
|
|
6189
|
+
] }, r.id)) })
|
|
6190
|
+
] }) })
|
|
6191
|
+
] }),
|
|
6110
6192
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("section", { children: [
|
|
6111
6193
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Line items" }),
|
|
6112
6194
|
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "min-w-0 overflow-x-auto border border-gray-200 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Table, { children: [
|
|
@@ -7829,33 +7911,50 @@ function RightSidebar({ theme, resolver, activeTab, setActiveTab, seoProps }) {
|
|
|
7829
7911
|
] })
|
|
7830
7912
|
] });
|
|
7831
7913
|
}
|
|
7832
|
-
function SaveButton({
|
|
7914
|
+
function SaveButton({
|
|
7915
|
+
pageId,
|
|
7916
|
+
pageData,
|
|
7917
|
+
existingSeoId,
|
|
7918
|
+
onSeoIdChange,
|
|
7919
|
+
onSaved,
|
|
7920
|
+
children,
|
|
7921
|
+
className
|
|
7922
|
+
}) {
|
|
7833
7923
|
const { query } = (0, import_core.useEditor)();
|
|
7834
7924
|
const [saving, setSaving] = (0, import_react38.useState)(false);
|
|
7835
7925
|
const handleSave = async () => {
|
|
7836
7926
|
setSaving(true);
|
|
7837
7927
|
try {
|
|
7838
7928
|
const content = JSON.parse(query.serialize());
|
|
7839
|
-
let
|
|
7840
|
-
const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords;
|
|
7929
|
+
let resolvedSeoId = existingSeoId;
|
|
7930
|
+
const hasSeo = pageData.seoTitle || pageData.seoDescription || pageData.seoKeywords || pageData.seoOgTitle || pageData.seoOgDescription || pageData.seoOgImage;
|
|
7841
7931
|
if (hasSeo) {
|
|
7842
7932
|
const seoPayload = {
|
|
7843
|
-
title: pageData.seoTitle,
|
|
7844
|
-
description: pageData.seoDescription,
|
|
7845
|
-
keywords: pageData.seoKeywords,
|
|
7846
|
-
ogTitle: pageData.seoOgTitle,
|
|
7847
|
-
ogDescription: pageData.seoOgDescription,
|
|
7848
|
-
ogImage: pageData.seoOgImage,
|
|
7933
|
+
title: pageData.seoTitle || null,
|
|
7934
|
+
description: pageData.seoDescription || null,
|
|
7935
|
+
keywords: pageData.seoKeywords || null,
|
|
7936
|
+
ogTitle: pageData.seoOgTitle || null,
|
|
7937
|
+
ogDescription: pageData.seoOgDescription || null,
|
|
7938
|
+
ogImage: pageData.seoOgImage || null,
|
|
7849
7939
|
slug: pageData.slug
|
|
7850
7940
|
};
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7941
|
+
if (existingSeoId) {
|
|
7942
|
+
const seoRes = await fetch(`/api/seos/${existingSeoId}`, {
|
|
7943
|
+
method: "PUT",
|
|
7944
|
+
headers: { "Content-Type": "application/json" },
|
|
7945
|
+
body: JSON.stringify(seoPayload)
|
|
7946
|
+
});
|
|
7947
|
+
if (seoRes.ok) resolvedSeoId = existingSeoId;
|
|
7948
|
+
} else {
|
|
7949
|
+
const seoRes = await fetch("/api/seos", {
|
|
7950
|
+
method: "POST",
|
|
7951
|
+
headers: { "Content-Type": "application/json" },
|
|
7952
|
+
body: JSON.stringify(seoPayload)
|
|
7953
|
+
});
|
|
7954
|
+
if (seoRes.ok) {
|
|
7955
|
+
const seoData = await seoRes.json();
|
|
7956
|
+
resolvedSeoId = seoData.id ?? null;
|
|
7957
|
+
}
|
|
7859
7958
|
}
|
|
7860
7959
|
}
|
|
7861
7960
|
const payload = {
|
|
@@ -7864,7 +7963,7 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
|
|
|
7864
7963
|
content,
|
|
7865
7964
|
published: pageData.published
|
|
7866
7965
|
};
|
|
7867
|
-
if (
|
|
7966
|
+
if (resolvedSeoId != null) payload.seoId = resolvedSeoId;
|
|
7868
7967
|
const url = pageId ? `/api/pages/${pageId}` : "/api/pages";
|
|
7869
7968
|
const method = pageId ? "PUT" : "POST";
|
|
7870
7969
|
const res = await fetch(url, {
|
|
@@ -7874,6 +7973,8 @@ function SaveButton({ pageId, pageData, onSaved, children, className }) {
|
|
|
7874
7973
|
});
|
|
7875
7974
|
if (res.ok) {
|
|
7876
7975
|
const saved = await res.json();
|
|
7976
|
+
const nextSeo = saved.seoId != null && saved.seoId !== "" ? Number(saved.seoId) : resolvedSeoId;
|
|
7977
|
+
if (Number.isFinite(nextSeo)) onSeoIdChange(nextSeo);
|
|
7877
7978
|
onSaved(saved.id?.toString() || pageId || "");
|
|
7878
7979
|
}
|
|
7879
7980
|
} finally {
|
|
@@ -7906,9 +8007,11 @@ function PageBuilderPage({ pageId }) {
|
|
|
7906
8007
|
const [seoOgTitle, setSeoOgTitle] = (0, import_react38.useState)("");
|
|
7907
8008
|
const [seoOgDescription, setSeoOgDescription] = (0, import_react38.useState)("");
|
|
7908
8009
|
const [seoOgImage, setSeoOgImage] = (0, import_react38.useState)("");
|
|
8010
|
+
const [pageSeoId, setPageSeoId] = (0, import_react38.useState)(null);
|
|
7909
8011
|
(0, import_react38.useEffect)(() => {
|
|
7910
8012
|
if (!pageId) {
|
|
7911
8013
|
setInitialContent(null);
|
|
8014
|
+
setPageSeoId(null);
|
|
7912
8015
|
setLoading(false);
|
|
7913
8016
|
return;
|
|
7914
8017
|
}
|
|
@@ -7917,6 +8020,9 @@ function PageBuilderPage({ pageId }) {
|
|
|
7917
8020
|
setTitle(data.title || "");
|
|
7918
8021
|
setSlug(data.slug || "");
|
|
7919
8022
|
setPublished(data.published || false);
|
|
8023
|
+
setPageSeoId(
|
|
8024
|
+
data.seoId != null && data.seoId !== "" ? Number(data.seoId) : data.seo?.id != null ? Number(data.seo.id) : null
|
|
8025
|
+
);
|
|
7920
8026
|
if (data.content) {
|
|
7921
8027
|
setInitialContent(JSON.stringify(data.content));
|
|
7922
8028
|
}
|
|
@@ -7970,6 +8076,8 @@ function PageBuilderPage({ pageId }) {
|
|
|
7970
8076
|
SaveButton,
|
|
7971
8077
|
{
|
|
7972
8078
|
pageId,
|
|
8079
|
+
existingSeoId: pageSeoId,
|
|
8080
|
+
onSeoIdChange: setPageSeoId,
|
|
7973
8081
|
pageData: { title, slug, published, seoTitle, seoDescription, seoKeywords, seoOgTitle, seoOgDescription, seoOgImage },
|
|
7974
8082
|
onSaved: (id) => {
|
|
7975
8083
|
if (!pageId) router.replace(`/admin/pages/${id}`);
|
|
@@ -8048,7 +8156,7 @@ function PageBuilderPage({ pageId }) {
|
|
|
8048
8156
|
|
|
8049
8157
|
// src/admin/pages/PluginsPage.tsx
|
|
8050
8158
|
var import_react40 = require("react");
|
|
8051
|
-
var
|
|
8159
|
+
var import_lucide_react32 = require("lucide-react");
|
|
8052
8160
|
|
|
8053
8161
|
// src/lib/email-recipients.ts
|
|
8054
8162
|
function parseEmailRecipientsFromConfig(raw) {
|
|
@@ -8069,15 +8177,57 @@ function serializeEmailRecipients(emails) {
|
|
|
8069
8177
|
return JSON.stringify(emails);
|
|
8070
8178
|
}
|
|
8071
8179
|
|
|
8180
|
+
// src/components/ui/checkbox.tsx
|
|
8181
|
+
var React19 = __toESM(require("react"), 1);
|
|
8182
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
|
|
8183
|
+
var import_lucide_react31 = require("lucide-react");
|
|
8184
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8185
|
+
var Checkbox = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8186
|
+
CheckboxPrimitive.Root,
|
|
8187
|
+
{
|
|
8188
|
+
ref,
|
|
8189
|
+
className: cn(
|
|
8190
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
8191
|
+
className
|
|
8192
|
+
),
|
|
8193
|
+
...props,
|
|
8194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8195
|
+
CheckboxPrimitive.Indicator,
|
|
8196
|
+
{
|
|
8197
|
+
className: cn("flex items-center justify-center text-current"),
|
|
8198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react31.Check, { className: "h-4 w-4" })
|
|
8199
|
+
}
|
|
8200
|
+
)
|
|
8201
|
+
}
|
|
8202
|
+
));
|
|
8203
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
8204
|
+
|
|
8072
8205
|
// src/admin/pages/PluginsPage.tsx
|
|
8073
8206
|
var import_sonner6 = require("sonner");
|
|
8074
|
-
var
|
|
8207
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8208
|
+
function normalizeChatMode(raw) {
|
|
8209
|
+
if (raw === "external" || raw === "llm") return raw;
|
|
8210
|
+
return "whatsapp";
|
|
8211
|
+
}
|
|
8075
8212
|
var ICON_MAP = {
|
|
8076
|
-
storage:
|
|
8077
|
-
email:
|
|
8078
|
-
payment:
|
|
8079
|
-
llm:
|
|
8213
|
+
storage: import_lucide_react32.HardDrive,
|
|
8214
|
+
email: import_lucide_react32.Mail,
|
|
8215
|
+
payment: import_lucide_react32.CreditCard,
|
|
8216
|
+
llm: import_lucide_react32.MessageCircle,
|
|
8217
|
+
analytics: import_lucide_react32.BarChart3,
|
|
8218
|
+
erp: import_lucide_react32.Building2,
|
|
8219
|
+
sms: import_lucide_react32.Smartphone
|
|
8080
8220
|
};
|
|
8221
|
+
function normalizeSmsProviderChoice(raw) {
|
|
8222
|
+
const x = (raw || "auto").toLowerCase().trim();
|
|
8223
|
+
if (x === "msg91" || x === "twilio" || x === "webhook" || x === "auto") return x;
|
|
8224
|
+
return "auto";
|
|
8225
|
+
}
|
|
8226
|
+
function normalizeMsg91ApiMode(raw) {
|
|
8227
|
+
const x = (raw || "auto").toLowerCase().trim();
|
|
8228
|
+
if (x === "flow" || x === "sendhttp" || x === "auto") return x;
|
|
8229
|
+
return "auto";
|
|
8230
|
+
}
|
|
8081
8231
|
function splitInputToEmails(input) {
|
|
8082
8232
|
return input.split(/[,;]+/).map((s) => s.trim()).filter(Boolean);
|
|
8083
8233
|
}
|
|
@@ -8130,27 +8280,27 @@ function EmailRecipientTags({
|
|
|
8130
8280
|
onChange(next);
|
|
8131
8281
|
setDraft("");
|
|
8132
8282
|
};
|
|
8133
|
-
return /* @__PURE__ */ (0,
|
|
8134
|
-
/* @__PURE__ */ (0,
|
|
8135
|
-
/* @__PURE__ */ (0,
|
|
8283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8284
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: id, className: "text-sm", children: label }),
|
|
8285
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8136
8286
|
"div",
|
|
8137
8287
|
{
|
|
8138
8288
|
className: "flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-background px-2 py-1.5 text-sm ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 dark:border-gray-600",
|
|
8139
8289
|
children: [
|
|
8140
|
-
emails.map((email) => /* @__PURE__ */ (0,
|
|
8141
|
-
/* @__PURE__ */ (0,
|
|
8142
|
-
/* @__PURE__ */ (0,
|
|
8290
|
+
emails.map((email) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Badge, { variant: "secondary", className: "gap-1 pr-0.5 font-normal", children: [
|
|
8291
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "max-w-[220px] truncate", children: email }),
|
|
8292
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8143
8293
|
"button",
|
|
8144
8294
|
{
|
|
8145
8295
|
type: "button",
|
|
8146
8296
|
className: "rounded p-0.5 hover:bg-muted",
|
|
8147
8297
|
"aria-label": `Remove ${email}`,
|
|
8148
8298
|
onClick: () => onChange(emails.filter((e) => e !== email)),
|
|
8149
|
-
children: /* @__PURE__ */ (0,
|
|
8299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.X, { className: "h-3 w-3" })
|
|
8150
8300
|
}
|
|
8151
8301
|
)
|
|
8152
8302
|
] }, email)),
|
|
8153
|
-
/* @__PURE__ */ (0,
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8154
8304
|
"input",
|
|
8155
8305
|
{
|
|
8156
8306
|
id,
|
|
@@ -8177,14 +8327,14 @@ function EmailRecipientTags({
|
|
|
8177
8327
|
]
|
|
8178
8328
|
}
|
|
8179
8329
|
),
|
|
8180
|
-
/* @__PURE__ */ (0,
|
|
8330
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: hint })
|
|
8181
8331
|
] });
|
|
8182
8332
|
}
|
|
8183
8333
|
function PluginIcon({ descriptor, size = "md" }) {
|
|
8184
|
-
const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ??
|
|
8334
|
+
const Icon2 = descriptor.icon ? ICON_MAP[descriptor.icon] ?? import_lucide_react32.Puzzle : import_lucide_react32.Puzzle;
|
|
8185
8335
|
const sizeClass = size === "sm" ? "h-8 w-8" : "h-11 w-11";
|
|
8186
8336
|
const iconClass = size === "sm" ? "h-4 w-4" : "h-5 w-5";
|
|
8187
|
-
return /* @__PURE__ */ (0,
|
|
8337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: `flex shrink-0 items-center justify-center rounded-lg bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 ${sizeClass}`, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon2, { className: iconClass }) });
|
|
8188
8338
|
}
|
|
8189
8339
|
function PluginSettingsPanel({
|
|
8190
8340
|
descriptor,
|
|
@@ -8193,6 +8343,8 @@ function PluginSettingsPanel({
|
|
|
8193
8343
|
const settingsGroup = descriptor.settingsGroup;
|
|
8194
8344
|
const isLlm = settingsGroup === "llm";
|
|
8195
8345
|
const isEmail = settingsGroup === "email";
|
|
8346
|
+
const isErp = settingsGroup === "erp";
|
|
8347
|
+
const isSms = settingsGroup === "sms";
|
|
8196
8348
|
const [enabled, setEnabled] = (0, import_react40.useState)(true);
|
|
8197
8349
|
const [botName, setBotName] = (0, import_react40.useState)("");
|
|
8198
8350
|
const [icon, setIcon] = (0, import_react40.useState)("");
|
|
@@ -8209,18 +8361,59 @@ function PluginSettingsPanel({
|
|
|
8209
8361
|
const [followUsTitle, setFollowUsTitle] = (0, import_react40.useState)("Follow Us");
|
|
8210
8362
|
const [socialLinkRows, setSocialLinkRows] = (0, import_react40.useState)([{ ...EMPTY_SOCIAL_ROW }]);
|
|
8211
8363
|
const [footerDisclaimer, setFooterDisclaimer] = (0, import_react40.useState)("");
|
|
8364
|
+
const [chatMode, setChatMode] = (0, import_react40.useState)("whatsapp");
|
|
8365
|
+
const [whatsappPhone, setWhatsappPhone] = (0, import_react40.useState)("");
|
|
8366
|
+
const [externalChatSnippet, setExternalChatSnippet] = (0, import_react40.useState)("");
|
|
8367
|
+
const [erpPipelineName, setErpPipelineName] = (0, import_react40.useState)("");
|
|
8368
|
+
const [erpPipelineStageName, setErpPipelineStageName] = (0, import_react40.useState)("");
|
|
8369
|
+
const [erpFormsCatalog, setErpFormsCatalog] = (0, import_react40.useState)([]);
|
|
8370
|
+
const [erpOpportunityFormIds, setErpOpportunityFormIds] = (0, import_react40.useState)([]);
|
|
8371
|
+
const [erpOpportunityIdsKeyPresent, setErpOpportunityIdsKeyPresent] = (0, import_react40.useState)(false);
|
|
8372
|
+
const [smsProviderChoice, setSmsProviderChoice] = (0, import_react40.useState)("auto");
|
|
8373
|
+
const [msg91ApiMode, setMsg91ApiMode] = (0, import_react40.useState)("auto");
|
|
8374
|
+
const [smsTplItems, setSmsTplItems] = (0, import_react40.useState)([]);
|
|
8212
8375
|
const [loading, setLoading] = (0, import_react40.useState)(true);
|
|
8213
8376
|
const [saving, setSaving] = (0, import_react40.useState)(false);
|
|
8214
8377
|
(0, import_react40.useEffect)(() => {
|
|
8215
|
-
|
|
8378
|
+
setLoading(true);
|
|
8379
|
+
fetch(`/api/settings/${settingsGroup}`).then((r) => r.ok ? r.json() : {}).then(async (data) => {
|
|
8216
8380
|
setEnabled(data.enabled !== "false");
|
|
8217
8381
|
setBotName(data.botName ?? "");
|
|
8218
8382
|
setIcon(data.icon ?? "");
|
|
8219
8383
|
if (isLlm) {
|
|
8384
|
+
setChatMode(normalizeChatMode(data.chatMode));
|
|
8385
|
+
setWhatsappPhone(data.whatsappPhone ?? "");
|
|
8386
|
+
setExternalChatSnippet(data.externalChatSnippet ?? "");
|
|
8220
8387
|
setIconImageUrl(data.iconImageUrl ?? "");
|
|
8221
8388
|
setIconBackgroundColor(data.iconBackgroundColor ?? "#6366f1");
|
|
8222
8389
|
setHeaderColor(data.headerColor ?? "#6366f1");
|
|
8223
8390
|
}
|
|
8391
|
+
if (isErp) {
|
|
8392
|
+
setErpPipelineName(data.pipelineName ?? data.pipelineId ?? "");
|
|
8393
|
+
setErpPipelineStageName(data.pipelineStageName ?? data.pipelineStageId ?? "");
|
|
8394
|
+
const rawOpp = data.opportunityFormIds;
|
|
8395
|
+
const keyPresent = rawOpp !== void 0 && rawOpp !== null && String(rawOpp).trim() !== "";
|
|
8396
|
+
setErpOpportunityIdsKeyPresent(keyPresent);
|
|
8397
|
+
if (keyPresent) {
|
|
8398
|
+
try {
|
|
8399
|
+
const p = JSON.parse(String(rawOpp));
|
|
8400
|
+
const ids = Array.isArray(p) ? p.map((x) => typeof x === "number" ? x : Number(x)).filter((n) => Number.isInteger(n) && n > 0) : [];
|
|
8401
|
+
setErpOpportunityFormIds([...new Set(ids)]);
|
|
8402
|
+
} catch {
|
|
8403
|
+
setErpOpportunityFormIds([]);
|
|
8404
|
+
}
|
|
8405
|
+
} else {
|
|
8406
|
+
setErpOpportunityFormIds([]);
|
|
8407
|
+
}
|
|
8408
|
+
}
|
|
8409
|
+
if (isSms) {
|
|
8410
|
+
setSmsProviderChoice(normalizeSmsProviderChoice(data.smsProvider ?? data.SMS_PROVIDER));
|
|
8411
|
+
setMsg91ApiMode(normalizeMsg91ApiMode(data.msg91ApiMode));
|
|
8412
|
+
const tr = await fetch("/api/message-templates/sms").then(
|
|
8413
|
+
(r) => r.ok ? r.json() : { items: [] }
|
|
8414
|
+
);
|
|
8415
|
+
setSmsTplItems(tr.items ?? []);
|
|
8416
|
+
}
|
|
8224
8417
|
if (isEmail) {
|
|
8225
8418
|
const sales = parseEmailRecipientsFromConfig(data.salesTeamEmails ?? data.salesTeamEmail);
|
|
8226
8419
|
const fulfil = parseEmailRecipientsFromConfig(data.fulfilmentTeamEmails ?? data.fulfilmentTeamEmail);
|
|
@@ -8237,14 +8430,48 @@ function PluginSettingsPanel({
|
|
|
8237
8430
|
setFooterDisclaimer(data.footerDisclaimer ?? "");
|
|
8238
8431
|
}
|
|
8239
8432
|
}).finally(() => setLoading(false));
|
|
8240
|
-
}, [settingsGroup, isLlm, isEmail]);
|
|
8433
|
+
}, [settingsGroup, isLlm, isEmail, isErp, isSms]);
|
|
8434
|
+
(0, import_react40.useEffect)(() => {
|
|
8435
|
+
if (!isErp || loading) return;
|
|
8436
|
+
fetch("/api/forms?limit=500&sortField=name&sortOrder=asc").then((r) => r.ok ? r.json() : { data: [] }).then((res) => {
|
|
8437
|
+
const rows = (res.data ?? []).map((f) => ({
|
|
8438
|
+
id: typeof f.id === "number" ? f.id : Number(f.id),
|
|
8439
|
+
name: String(f.name ?? "")
|
|
8440
|
+
})).filter((f) => Number.isInteger(f.id) && f.id > 0);
|
|
8441
|
+
setErpFormsCatalog(rows);
|
|
8442
|
+
}).catch(() => setErpFormsCatalog([]));
|
|
8443
|
+
}, [isErp, loading]);
|
|
8241
8444
|
const buildPayload = () => {
|
|
8445
|
+
if (isErp) {
|
|
8446
|
+
const sortedIds = [...new Set(erpOpportunityFormIds.filter((n) => Number.isInteger(n) && n > 0))].sort(
|
|
8447
|
+
(a, b) => a - b
|
|
8448
|
+
);
|
|
8449
|
+
const payload2 = {
|
|
8450
|
+
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8451
|
+
pipelineName: { value: erpPipelineName, type: "public" },
|
|
8452
|
+
pipelineStageName: { value: erpPipelineStageName, type: "public" }
|
|
8453
|
+
};
|
|
8454
|
+
if (erpFormsCatalog.length > 0 || erpOpportunityIdsKeyPresent) {
|
|
8455
|
+
payload2.opportunityFormIds = { value: JSON.stringify(sortedIds), type: "public" };
|
|
8456
|
+
}
|
|
8457
|
+
return payload2;
|
|
8458
|
+
}
|
|
8459
|
+
if (isSms) {
|
|
8460
|
+
return {
|
|
8461
|
+
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8462
|
+
smsProvider: { value: smsProviderChoice, type: "public" },
|
|
8463
|
+
msg91ApiMode: { value: msg91ApiMode, type: "public" }
|
|
8464
|
+
};
|
|
8465
|
+
}
|
|
8242
8466
|
const payload = {
|
|
8243
8467
|
enabled: { value: enabled ? "true" : "false", type: "public" },
|
|
8244
8468
|
botName: { value: botName, type: "public" },
|
|
8245
8469
|
icon: { value: icon, type: "public" }
|
|
8246
8470
|
};
|
|
8247
8471
|
if (isLlm) {
|
|
8472
|
+
payload.chatMode = { value: chatMode, type: "public" };
|
|
8473
|
+
payload.whatsappPhone = { value: whatsappPhone, type: "public" };
|
|
8474
|
+
payload.externalChatSnippet = { value: externalChatSnippet, type: "public" };
|
|
8248
8475
|
payload.iconImageUrl = { value: iconImageUrl, type: "public" };
|
|
8249
8476
|
payload.iconBackgroundColor = { value: iconBackgroundColor, type: "public" };
|
|
8250
8477
|
payload.headerColor = { value: headerColor, type: "public" };
|
|
@@ -8272,6 +8499,22 @@ function PluginSettingsPanel({
|
|
|
8272
8499
|
body: JSON.stringify(buildPayload())
|
|
8273
8500
|
});
|
|
8274
8501
|
if (!res.ok) throw new Error();
|
|
8502
|
+
if (isSms && smsTplItems.length > 0) {
|
|
8503
|
+
const res2 = await fetch("/api/message-templates/sms", {
|
|
8504
|
+
method: "PUT",
|
|
8505
|
+
headers: { "Content-Type": "application/json" },
|
|
8506
|
+
body: JSON.stringify({
|
|
8507
|
+
items: smsTplItems.map((t) => ({
|
|
8508
|
+
templateKey: t.templateKey,
|
|
8509
|
+
body: t.body,
|
|
8510
|
+
externalTemplateRef: t.externalTemplateRef,
|
|
8511
|
+
otpVarKey: t.otpVarKey,
|
|
8512
|
+
enabled: t.enabled
|
|
8513
|
+
}))
|
|
8514
|
+
})
|
|
8515
|
+
});
|
|
8516
|
+
if (!res2.ok) throw new Error();
|
|
8517
|
+
}
|
|
8275
8518
|
import_sonner6.toast.success("Settings saved");
|
|
8276
8519
|
onSaved?.();
|
|
8277
8520
|
} catch {
|
|
@@ -8280,10 +8523,101 @@ function PluginSettingsPanel({
|
|
|
8280
8523
|
setSaving(false);
|
|
8281
8524
|
}
|
|
8282
8525
|
};
|
|
8283
|
-
if (loading) return /* @__PURE__ */ (0,
|
|
8526
|
+
if (loading) return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Loading..." });
|
|
8527
|
+
if (isErp) {
|
|
8528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8529
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8530
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8531
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8532
|
+
] }),
|
|
8533
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Webhook URL and JWT are set in server environment (see ERP integration guide). Pipeline fields apply to form submissions that are sent as opportunities." }),
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8535
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-pipelineName`, className: "text-sm", children: "Pipeline name" }),
|
|
8536
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8537
|
+
Input,
|
|
8538
|
+
{
|
|
8539
|
+
id: `${settingsGroup}-pipelineName`,
|
|
8540
|
+
value: erpPipelineName,
|
|
8541
|
+
onChange: (e) => setErpPipelineName(e.target.value),
|
|
8542
|
+
placeholder: "e.g. Sales",
|
|
8543
|
+
className: "h-8 text-sm"
|
|
8544
|
+
}
|
|
8545
|
+
)
|
|
8546
|
+
] }),
|
|
8547
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-pipelineStageName`, className: "text-sm", children: "Pipeline stage name" }),
|
|
8549
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8550
|
+
Input,
|
|
8551
|
+
{
|
|
8552
|
+
id: `${settingsGroup}-pipelineStageName`,
|
|
8553
|
+
value: erpPipelineStageName,
|
|
8554
|
+
onChange: (e) => setErpPipelineStageName(e.target.value),
|
|
8555
|
+
placeholder: "e.g. New",
|
|
8556
|
+
className: "h-8 text-sm"
|
|
8557
|
+
}
|
|
8558
|
+
)
|
|
8559
|
+
] }),
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2", children: [
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
8562
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-sm", children: "Forms as CRM opportunity" }),
|
|
8563
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-2 text-xs", children: [
|
|
8564
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8565
|
+
"button",
|
|
8566
|
+
{
|
|
8567
|
+
type: "button",
|
|
8568
|
+
className: "text-primary underline-offset-2 hover:underline",
|
|
8569
|
+
onClick: () => setErpOpportunityFormIds(erpFormsCatalog.map((f) => f.id)),
|
|
8570
|
+
children: "Select all"
|
|
8571
|
+
}
|
|
8572
|
+
),
|
|
8573
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8574
|
+
"button",
|
|
8575
|
+
{
|
|
8576
|
+
type: "button",
|
|
8577
|
+
className: "text-primary underline-offset-2 hover:underline",
|
|
8578
|
+
onClick: () => setErpOpportunityFormIds([]),
|
|
8579
|
+
children: "Clear"
|
|
8580
|
+
}
|
|
8581
|
+
)
|
|
8582
|
+
] })
|
|
8583
|
+
] }),
|
|
8584
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8585
|
+
"Every form submission with an email is sent to ERP: unchecked forms use ",
|
|
8586
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-medium", children: "lead" }),
|
|
8587
|
+
" (",
|
|
8588
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "lead.created" }),
|
|
8589
|
+
"); checked forms use ",
|
|
8590
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-medium", children: "opportunity" }),
|
|
8591
|
+
" (",
|
|
8592
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "form.submitted" }),
|
|
8593
|
+
") with the pipeline and stage above."
|
|
8594
|
+
] }),
|
|
8595
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "max-h-48 space-y-2 overflow-y-auto rounded-md border border-input p-2 dark:border-gray-600", children: erpFormsCatalog.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "No forms found." }) : erpFormsCatalog.map((f) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("label", { className: "flex cursor-pointer items-center gap-2 text-sm", children: [
|
|
8596
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8597
|
+
Checkbox,
|
|
8598
|
+
{
|
|
8599
|
+
checked: erpOpportunityFormIds.includes(f.id),
|
|
8600
|
+
onCheckedChange: (c) => {
|
|
8601
|
+
const on = c === true;
|
|
8602
|
+
setErpOpportunityFormIds((prev) => {
|
|
8603
|
+
if (on) return prev.includes(f.id) ? prev : [...prev, f.id].sort((a, b) => a - b);
|
|
8604
|
+
return prev.filter((x) => x !== f.id);
|
|
8605
|
+
});
|
|
8606
|
+
}
|
|
8607
|
+
}
|
|
8608
|
+
),
|
|
8609
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "min-w-0 truncate", children: f.name || `Form #${f.id}` })
|
|
8610
|
+
] }, f.id)) })
|
|
8611
|
+
] }),
|
|
8612
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
8613
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8614
|
+
"Save"
|
|
8615
|
+
] })
|
|
8616
|
+
] });
|
|
8617
|
+
}
|
|
8284
8618
|
if (isEmail) {
|
|
8285
|
-
return /* @__PURE__ */ (0,
|
|
8286
|
-
/* @__PURE__ */ (0,
|
|
8619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8620
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8287
8621
|
EmailRecipientTags,
|
|
8288
8622
|
{
|
|
8289
8623
|
id: `${settingsGroup}-salesTeamEmails`,
|
|
@@ -8294,7 +8628,7 @@ function PluginSettingsPanel({
|
|
|
8294
8628
|
placeholder: "e.g. sales@example.com"
|
|
8295
8629
|
}
|
|
8296
8630
|
),
|
|
8297
|
-
/* @__PURE__ */ (0,
|
|
8631
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8298
8632
|
EmailRecipientTags,
|
|
8299
8633
|
{
|
|
8300
8634
|
id: `${settingsGroup}-fulfilmentTeamEmails`,
|
|
@@ -8305,7 +8639,7 @@ function PluginSettingsPanel({
|
|
|
8305
8639
|
placeholder: "e.g. fulfilment@example.com"
|
|
8306
8640
|
}
|
|
8307
8641
|
),
|
|
8308
|
-
/* @__PURE__ */ (0,
|
|
8642
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8309
8643
|
EmailRecipientTags,
|
|
8310
8644
|
{
|
|
8311
8645
|
id: `${settingsGroup}-crmEmails`,
|
|
@@ -8316,34 +8650,34 @@ function PluginSettingsPanel({
|
|
|
8316
8650
|
placeholder: "e.g. crm@example.com"
|
|
8317
8651
|
}
|
|
8318
8652
|
),
|
|
8319
|
-
/* @__PURE__ */ (0,
|
|
8320
|
-
/* @__PURE__ */ (0,
|
|
8321
|
-
/* @__PURE__ */ (0,
|
|
8322
|
-
/* @__PURE__ */ (0,
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Layout below merges with Branding settings; values here override branding when set. Use absolute URLs for logos in email." }),
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8655
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-logoUrl`, className: "text-sm", children: "Logo URL (optional override)" }),
|
|
8656
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-logoUrl`, value: logoUrl, onChange: (e) => setLogoUrl(e.target.value), placeholder: "https://\u2026", className: "h-8 text-sm" })
|
|
8323
8657
|
] }),
|
|
8324
|
-
/* @__PURE__ */ (0,
|
|
8325
|
-
/* @__PURE__ */ (0,
|
|
8326
|
-
/* @__PURE__ */ (0,
|
|
8658
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8659
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-companyName`, className: "text-sm", children: "Company name (optional override)" }),
|
|
8660
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-companyName`, value: companyName, onChange: (e) => setCompanyName(e.target.value), className: "h-8 text-sm" })
|
|
8327
8661
|
] }),
|
|
8328
|
-
/* @__PURE__ */ (0,
|
|
8329
|
-
/* @__PURE__ */ (0,
|
|
8330
|
-
/* @__PURE__ */ (0,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-supportEmail`, className: "text-sm", children: "Support email (footer)" }),
|
|
8664
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-supportEmail`, value: supportEmail, onChange: (e) => setSupportEmail(e.target.value), type: "email", className: "h-8 text-sm" })
|
|
8331
8665
|
] }),
|
|
8332
|
-
/* @__PURE__ */ (0,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8334
|
-
/* @__PURE__ */ (0,
|
|
8666
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8667
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-supportPhone`, className: "text-sm", children: "Support phone (footer)" }),
|
|
8668
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-supportPhone`, value: supportPhone, onChange: (e) => setSupportPhone(e.target.value), className: "h-8 text-sm" })
|
|
8335
8669
|
] }),
|
|
8336
|
-
/* @__PURE__ */ (0,
|
|
8337
|
-
/* @__PURE__ */ (0,
|
|
8338
|
-
/* @__PURE__ */ (0,
|
|
8670
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8671
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-followUsTitle`, className: "text-sm", children: "\u201CFollow us\u201D heading" }),
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Input, { id: `${settingsGroup}-followUsTitle`, value: followUsTitle, onChange: (e) => setFollowUsTitle(e.target.value), className: "h-8 text-sm" })
|
|
8339
8673
|
] }),
|
|
8340
|
-
/* @__PURE__ */ (0,
|
|
8341
|
-
/* @__PURE__ */ (0,
|
|
8342
|
-
/* @__PURE__ */ (0,
|
|
8343
|
-
socialLinkRows.map((row, i) => /* @__PURE__ */ (0,
|
|
8344
|
-
/* @__PURE__ */ (0,
|
|
8345
|
-
/* @__PURE__ */ (0,
|
|
8346
|
-
/* @__PURE__ */ (0,
|
|
8674
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2", children: [
|
|
8675
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-sm", children: "Social links" }),
|
|
8676
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Add rows: icon image URL (optional), link URL, and emoji/text only if you are not using an image." }),
|
|
8677
|
+
socialLinkRows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-end gap-2 border-b border-border/60 pb-3 dark:border-gray-600", children: [
|
|
8678
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Icon image URL" }),
|
|
8680
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8347
8681
|
Input,
|
|
8348
8682
|
{
|
|
8349
8683
|
value: row.iconUrl,
|
|
@@ -8357,9 +8691,9 @@ function PluginSettingsPanel({
|
|
|
8357
8691
|
}
|
|
8358
8692
|
)
|
|
8359
8693
|
] }),
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8362
|
-
/* @__PURE__ */ (0,
|
|
8694
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-[160px] flex-1 space-y-1", children: [
|
|
8695
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Link URL" }),
|
|
8696
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8363
8697
|
Input,
|
|
8364
8698
|
{
|
|
8365
8699
|
value: row.url,
|
|
@@ -8373,9 +8707,9 @@ function PluginSettingsPanel({
|
|
|
8373
8707
|
}
|
|
8374
8708
|
)
|
|
8375
8709
|
] }),
|
|
8376
|
-
/* @__PURE__ */ (0,
|
|
8377
|
-
/* @__PURE__ */ (0,
|
|
8378
|
-
/* @__PURE__ */ (0,
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "w-[120px] space-y-1", children: [
|
|
8711
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs text-muted-foreground", children: "Emoji / text" }),
|
|
8712
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8379
8713
|
Input,
|
|
8380
8714
|
{
|
|
8381
8715
|
value: row.iconFallback,
|
|
@@ -8389,7 +8723,7 @@ function PluginSettingsPanel({
|
|
|
8389
8723
|
}
|
|
8390
8724
|
)
|
|
8391
8725
|
] }),
|
|
8392
|
-
/* @__PURE__ */ (0,
|
|
8726
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8393
8727
|
Button,
|
|
8394
8728
|
{
|
|
8395
8729
|
type: "button",
|
|
@@ -8402,11 +8736,11 @@ function PluginSettingsPanel({
|
|
|
8402
8736
|
if (socialLinkRows.length <= 1) setSocialLinkRows([{ ...EMPTY_SOCIAL_ROW }]);
|
|
8403
8737
|
else setSocialLinkRows(socialLinkRows.filter((_, j) => j !== i));
|
|
8404
8738
|
},
|
|
8405
|
-
children: /* @__PURE__ */ (0,
|
|
8739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.X, { className: "h-4 w-4" })
|
|
8406
8740
|
}
|
|
8407
8741
|
)
|
|
8408
8742
|
] }, i)),
|
|
8409
|
-
/* @__PURE__ */ (0,
|
|
8743
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8410
8744
|
Button,
|
|
8411
8745
|
{
|
|
8412
8746
|
type: "button",
|
|
@@ -8415,15 +8749,15 @@ function PluginSettingsPanel({
|
|
|
8415
8749
|
className: "mt-1",
|
|
8416
8750
|
onClick: () => setSocialLinkRows([...socialLinkRows, { ...EMPTY_SOCIAL_ROW }]),
|
|
8417
8751
|
children: [
|
|
8418
|
-
/* @__PURE__ */ (0,
|
|
8752
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Plus, { className: "mr-1 h-4 w-4" }),
|
|
8419
8753
|
"Add link"
|
|
8420
8754
|
]
|
|
8421
8755
|
}
|
|
8422
8756
|
)
|
|
8423
8757
|
] }),
|
|
8424
|
-
/* @__PURE__ */ (0,
|
|
8425
|
-
/* @__PURE__ */ (0,
|
|
8426
|
-
/* @__PURE__ */ (0,
|
|
8758
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8759
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-footerDisclaimer`, className: "text-sm", children: "Footer disclaimer" }),
|
|
8760
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8427
8761
|
Textarea,
|
|
8428
8762
|
{
|
|
8429
8763
|
id: `${settingsGroup}-footerDisclaimer`,
|
|
@@ -8434,106 +8768,318 @@ function PluginSettingsPanel({
|
|
|
8434
8768
|
}
|
|
8435
8769
|
)
|
|
8436
8770
|
] }),
|
|
8437
|
-
/* @__PURE__ */ (0,
|
|
8771
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Button, { size: "sm", onClick: handleSave, disabled: saving, children: saving ? "Saving\u2026" : "Save" })
|
|
8438
8772
|
] });
|
|
8439
8773
|
}
|
|
8440
|
-
|
|
8441
|
-
/* @__PURE__ */ (0,
|
|
8442
|
-
/* @__PURE__ */ (0,
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "space-y-1", children: [
|
|
8446
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
8447
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8448
|
-
Input,
|
|
8449
|
-
{
|
|
8450
|
-
id: `${settingsGroup}-botName`,
|
|
8451
|
-
value: botName,
|
|
8452
|
-
onChange: (e) => setBotName(e.target.value),
|
|
8453
|
-
placeholder: "e.g. Support Bot",
|
|
8454
|
-
className: "h-8 text-sm"
|
|
8455
|
-
}
|
|
8456
|
-
)
|
|
8457
|
-
] }),
|
|
8458
|
-
isLlm ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
8459
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "space-y-1", children: [
|
|
8460
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
|
|
8461
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8462
|
-
Input,
|
|
8463
|
-
{
|
|
8464
|
-
id: `${settingsGroup}-iconImageUrl`,
|
|
8465
|
-
value: iconImageUrl,
|
|
8466
|
-
onChange: (e) => setIconImageUrl(e.target.value),
|
|
8467
|
-
placeholder: "https://\u2026 or /images/chat-icon.png",
|
|
8468
|
-
className: "h-8 text-sm"
|
|
8469
|
-
}
|
|
8470
|
-
),
|
|
8471
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
|
|
8774
|
+
if (isSms) {
|
|
8775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8776
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8472
8779
|
] }),
|
|
8473
|
-
/* @__PURE__ */ (0,
|
|
8474
|
-
/* @__PURE__ */ (0,
|
|
8475
|
-
/* @__PURE__ */ (0,
|
|
8476
|
-
|
|
8780
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8781
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-smsProvider`, className: "text-sm", children: "Active provider" }),
|
|
8782
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8783
|
+
Select,
|
|
8477
8784
|
{
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8785
|
+
value: smsProviderChoice,
|
|
8786
|
+
onValueChange: (v) => setSmsProviderChoice(v),
|
|
8787
|
+
children: [
|
|
8788
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-smsProvider`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select provider" }) }),
|
|
8789
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8790
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "auto", children: "Auto (MSG91 \u2192 Twilio \u2192 webhook, first with credentials)" }),
|
|
8791
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "msg91", children: "MSG91 (India)" }),
|
|
8792
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "twilio", children: "Twilio" }),
|
|
8793
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "webhook", children: "HTTP webhook" })
|
|
8794
|
+
] })
|
|
8795
|
+
]
|
|
8483
8796
|
}
|
|
8484
8797
|
)
|
|
8485
8798
|
] }),
|
|
8486
|
-
/* @__PURE__ */ (0,
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8488
|
-
|
|
8489
|
-
/* @__PURE__ */ (0,
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
id: `${settingsGroup}-iconBg`,
|
|
8495
|
-
value: iconBackgroundColor,
|
|
8496
|
-
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
8497
|
-
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
8498
|
-
}
|
|
8499
|
-
),
|
|
8500
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8501
|
-
Input,
|
|
8502
|
-
{
|
|
8503
|
-
value: iconBackgroundColor,
|
|
8504
|
-
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
8505
|
-
className: "h-8 w-24 text-sm font-mono"
|
|
8506
|
-
}
|
|
8507
|
-
)
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-msg91ApiMode`, className: "text-sm", children: "MSG91 API mode" }),
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Select, { value: msg91ApiMode, onValueChange: (v) => setMsg91ApiMode(v), children: [
|
|
8802
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-msg91ApiMode`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, {}) }),
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "auto", children: "Auto (Flow if template ID + auth key; else sendhttp)" }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "flow", children: "Flow API (DLT template_id; recommended for India)" }),
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "sendhttp", children: "Legacy sendhttp (needs sender ID; not for arbitrary India text)" })
|
|
8508
8807
|
] })
|
|
8808
|
+
] })
|
|
8809
|
+
] }),
|
|
8810
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-3 rounded-md border border-gray-200 dark:border-gray-600 p-3", children: [
|
|
8811
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "SMS templates" }),
|
|
8812
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8813
|
+
"Defaults come from code; overrides and DLT / Flow IDs are stored here. Use ",
|
|
8814
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "{{code}}" }),
|
|
8815
|
+
" in the message body for the OTP."
|
|
8509
8816
|
] }),
|
|
8510
|
-
/* @__PURE__ */ (0,
|
|
8511
|
-
/* @__PURE__ */ (0,
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
"
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8522
|
-
|
|
8523
|
-
|
|
8524
|
-
|
|
8817
|
+
smsTplItems.map((t) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-2 border-t border-gray-100 pt-3 first:border-t-0 first:pt-0 dark:border-gray-700", children: [
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
|
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { children: [
|
|
8820
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-sm font-medium", children: t.name }),
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "text-[11px] font-mono text-gray-500", children: t.templateKey })
|
|
8822
|
+
] }),
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8824
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-tpl-${t.templateKey}-enabled`, className: "text-xs text-gray-600 dark:text-gray-400", children: "Apply custom body / Flow id" }),
|
|
8825
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8826
|
+
Switch,
|
|
8827
|
+
{
|
|
8828
|
+
id: `${settingsGroup}-tpl-${t.templateKey}-enabled`,
|
|
8829
|
+
checked: t.enabled,
|
|
8830
|
+
onCheckedChange: (v) => setSmsTplItems(
|
|
8831
|
+
(items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, enabled: v } : x)
|
|
8832
|
+
)
|
|
8833
|
+
}
|
|
8834
|
+
)
|
|
8835
|
+
] })
|
|
8836
|
+
] }),
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-[11px] text-gray-500", children: [
|
|
8838
|
+
"Default: ",
|
|
8839
|
+
t.defaultBody
|
|
8840
|
+
] }),
|
|
8841
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "Message body" }),
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8844
|
+
Textarea,
|
|
8525
8845
|
{
|
|
8526
|
-
value:
|
|
8527
|
-
onChange: (e) =>
|
|
8528
|
-
|
|
8846
|
+
value: t.body,
|
|
8847
|
+
onChange: (e) => setSmsTplItems(
|
|
8848
|
+
(items) => items.map((x) => x.templateKey === t.templateKey ? { ...x, body: e.target.value } : x)
|
|
8849
|
+
),
|
|
8850
|
+
rows: 2,
|
|
8851
|
+
className: "text-sm"
|
|
8529
8852
|
}
|
|
8530
8853
|
)
|
|
8854
|
+
] }),
|
|
8855
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "grid gap-2 sm:grid-cols-2", children: [
|
|
8856
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8857
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "External template ref (e.g. MSG91 Flow / DLT id)" }),
|
|
8858
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8859
|
+
Input,
|
|
8860
|
+
{
|
|
8861
|
+
value: t.externalTemplateRef,
|
|
8862
|
+
onChange: (e) => setSmsTplItems(
|
|
8863
|
+
(items) => items.map(
|
|
8864
|
+
(x) => x.templateKey === t.templateKey ? { ...x, externalTemplateRef: e.target.value } : x
|
|
8865
|
+
)
|
|
8866
|
+
),
|
|
8867
|
+
placeholder: "From MSG91 after DLT mapping",
|
|
8868
|
+
className: "h-8 text-sm"
|
|
8869
|
+
}
|
|
8870
|
+
)
|
|
8871
|
+
] }),
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { className: "text-xs", children: "OTP variable key (Flow recipient field)" }),
|
|
8874
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8875
|
+
Input,
|
|
8876
|
+
{
|
|
8877
|
+
value: t.otpVarKey,
|
|
8878
|
+
onChange: (e) => setSmsTplItems(
|
|
8879
|
+
(items) => items.map(
|
|
8880
|
+
(x) => x.templateKey === t.templateKey ? { ...x, otpVarKey: e.target.value } : x
|
|
8881
|
+
)
|
|
8882
|
+
),
|
|
8883
|
+
className: "h-8 text-sm font-mono",
|
|
8884
|
+
placeholder: "var1"
|
|
8885
|
+
}
|
|
8886
|
+
)
|
|
8887
|
+
] })
|
|
8888
|
+
] })
|
|
8889
|
+
] }, t.templateKey))
|
|
8890
|
+
] }),
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
|
|
8892
|
+
"Server env: ",
|
|
8893
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_AUTH_KEY" }),
|
|
8894
|
+
"; optional global fallback ",
|
|
8895
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_TEMPLATE_ID" }),
|
|
8896
|
+
",",
|
|
8897
|
+
" ",
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_OTP_VAR_KEY" }),
|
|
8899
|
+
"; sendhttp: ",
|
|
8900
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_SENDER_ID" }),
|
|
8901
|
+
",",
|
|
8902
|
+
" ",
|
|
8903
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "MSG91_ROUTE" }),
|
|
8904
|
+
". Or ",
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "TWILIO_*" }),
|
|
8906
|
+
", ",
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "SMS_WEBHOOK_URL" }),
|
|
8908
|
+
".",
|
|
8909
|
+
" ",
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("code", { className: "text-[11px]", children: "SMS_PROVIDER" }),
|
|
8911
|
+
" matches the provider dropdown."
|
|
8912
|
+
] }),
|
|
8913
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "India (TRAI DLT): register content on operators; map the approved template in MSG91 and set the Flow id per template above." }),
|
|
8914
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
8915
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8916
|
+
"Save"
|
|
8917
|
+
] })
|
|
8918
|
+
] });
|
|
8919
|
+
}
|
|
8920
|
+
if (isLlm) {
|
|
8921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
8922
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8923
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
8924
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
8925
|
+
] }),
|
|
8926
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8927
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-chatMode`, className: "text-sm", children: "Support channel" }),
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Select, { value: chatMode, onValueChange: (v) => setChatMode(v), children: [
|
|
8929
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectTrigger, { id: `${settingsGroup}-chatMode`, className: "h-9 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectValue, { placeholder: "Select channel" }) }),
|
|
8930
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(SelectContent, { children: [
|
|
8931
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "whatsapp", children: "WhatsApp" }),
|
|
8932
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "external", children: "External (script)" }),
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SelectItem, { value: "llm", children: "Infuro Chat Assistant" })
|
|
8531
8934
|
] })
|
|
8532
8935
|
] })
|
|
8936
|
+
] }),
|
|
8937
|
+
chatMode === "whatsapp" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8938
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-whatsappPhone`, className: "text-sm", children: "Phone number" }),
|
|
8939
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8940
|
+
Input,
|
|
8941
|
+
{
|
|
8942
|
+
id: `${settingsGroup}-whatsappPhone`,
|
|
8943
|
+
value: whatsappPhone,
|
|
8944
|
+
onChange: (e) => setWhatsappPhone(e.target.value),
|
|
8945
|
+
placeholder: "e.g. +1 555 123 4567",
|
|
8946
|
+
className: "h-8 text-sm"
|
|
8947
|
+
}
|
|
8948
|
+
),
|
|
8949
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Include country code. Opens WhatsApp (wa.me) when visitors tap the site button." })
|
|
8950
|
+
] }),
|
|
8951
|
+
chatMode === "external" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8952
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-externalSnippet`, className: "text-sm", children: "Embed script" }),
|
|
8953
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8954
|
+
Textarea,
|
|
8955
|
+
{
|
|
8956
|
+
id: `${settingsGroup}-externalSnippet`,
|
|
8957
|
+
value: externalChatSnippet,
|
|
8958
|
+
onChange: (e) => setExternalChatSnippet(e.target.value),
|
|
8959
|
+
rows: 8,
|
|
8960
|
+
placeholder: "Paste third-party widget HTML / script tags\u2026",
|
|
8961
|
+
className: "text-sm font-mono"
|
|
8962
|
+
}
|
|
8963
|
+
),
|
|
8964
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Only paste code from sources you trust." })
|
|
8965
|
+
] }),
|
|
8966
|
+
chatMode === "llm" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
8967
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8968
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
8969
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8970
|
+
Input,
|
|
8971
|
+
{
|
|
8972
|
+
id: `${settingsGroup}-botName`,
|
|
8973
|
+
value: botName,
|
|
8974
|
+
onChange: (e) => setBotName(e.target.value),
|
|
8975
|
+
placeholder: "e.g. Support Bot",
|
|
8976
|
+
className: "h-8 text-sm"
|
|
8977
|
+
}
|
|
8978
|
+
)
|
|
8979
|
+
] }),
|
|
8980
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8981
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-iconImageUrl`, className: "text-sm", children: "Icon image URL" }),
|
|
8982
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8983
|
+
Input,
|
|
8984
|
+
{
|
|
8985
|
+
id: `${settingsGroup}-iconImageUrl`,
|
|
8986
|
+
value: iconImageUrl,
|
|
8987
|
+
onChange: (e) => setIconImageUrl(e.target.value),
|
|
8988
|
+
placeholder: "https://\u2026 or /images/chat-icon.png",
|
|
8989
|
+
className: "h-8 text-sm"
|
|
8990
|
+
}
|
|
8991
|
+
),
|
|
8992
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: "PNG or image URL. Leave empty to use emoji below." })
|
|
8993
|
+
] }),
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
8995
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon fallback (emoji)" }),
|
|
8996
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8997
|
+
Input,
|
|
8998
|
+
{
|
|
8999
|
+
id: `${settingsGroup}-icon`,
|
|
9000
|
+
value: icon,
|
|
9001
|
+
onChange: (e) => setIcon(e.target.value),
|
|
9002
|
+
placeholder: "e.g. \u{1F4AC}",
|
|
9003
|
+
className: "h-8 text-sm w-20"
|
|
9004
|
+
}
|
|
9005
|
+
)
|
|
9006
|
+
] }),
|
|
9007
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-4", children: [
|
|
9008
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9009
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-iconBg`, className: "text-sm", children: "Icon background" }),
|
|
9010
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9011
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9012
|
+
"input",
|
|
9013
|
+
{
|
|
9014
|
+
type: "color",
|
|
9015
|
+
id: `${settingsGroup}-iconBg`,
|
|
9016
|
+
value: iconBackgroundColor,
|
|
9017
|
+
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
9018
|
+
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
9019
|
+
}
|
|
9020
|
+
),
|
|
9021
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9022
|
+
Input,
|
|
9023
|
+
{
|
|
9024
|
+
value: iconBackgroundColor,
|
|
9025
|
+
onChange: (e) => setIconBackgroundColor(e.target.value),
|
|
9026
|
+
className: "h-8 w-24 text-sm font-mono"
|
|
9027
|
+
}
|
|
9028
|
+
)
|
|
9029
|
+
] })
|
|
9030
|
+
] }),
|
|
9031
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9032
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-headerColor`, className: "text-sm", children: "Header color" }),
|
|
9033
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
9034
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9035
|
+
"input",
|
|
9036
|
+
{
|
|
9037
|
+
type: "color",
|
|
9038
|
+
id: `${settingsGroup}-headerColor`,
|
|
9039
|
+
value: headerColor,
|
|
9040
|
+
onChange: (e) => setHeaderColor(e.target.value),
|
|
9041
|
+
className: "h-8 w-10 cursor-pointer rounded border border-gray-300 dark:border-gray-600"
|
|
9042
|
+
}
|
|
9043
|
+
),
|
|
9044
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9045
|
+
Input,
|
|
9046
|
+
{
|
|
9047
|
+
value: headerColor,
|
|
9048
|
+
onChange: (e) => setHeaderColor(e.target.value),
|
|
9049
|
+
className: "h-8 w-24 text-sm font-mono"
|
|
9050
|
+
}
|
|
9051
|
+
)
|
|
9052
|
+
] })
|
|
9053
|
+
] })
|
|
9054
|
+
] })
|
|
9055
|
+
] }),
|
|
9056
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
9057
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
9058
|
+
"Save"
|
|
8533
9059
|
] })
|
|
8534
|
-
] })
|
|
8535
|
-
|
|
8536
|
-
|
|
9060
|
+
] });
|
|
9061
|
+
}
|
|
9062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-4", children: [
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
9064
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-enabled`, className: "text-sm", children: "Enabled" }),
|
|
9065
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Switch, { id: `${settingsGroup}-enabled`, checked: enabled, onCheckedChange: setEnabled })
|
|
9066
|
+
] }),
|
|
9067
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9068
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-botName`, className: "text-sm", children: "Name" }),
|
|
9069
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
9070
|
+
Input,
|
|
9071
|
+
{
|
|
9072
|
+
id: `${settingsGroup}-botName`,
|
|
9073
|
+
value: botName,
|
|
9074
|
+
onChange: (e) => setBotName(e.target.value),
|
|
9075
|
+
placeholder: "e.g. Support Bot",
|
|
9076
|
+
className: "h-8 text-sm"
|
|
9077
|
+
}
|
|
9078
|
+
)
|
|
9079
|
+
] }),
|
|
9080
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "space-y-1", children: [
|
|
9081
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Label3, { htmlFor: `${settingsGroup}-icon`, className: "text-sm", children: "Icon (emoji or name)" }),
|
|
9082
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8537
9083
|
Input,
|
|
8538
9084
|
{
|
|
8539
9085
|
id: `${settingsGroup}-icon`,
|
|
@@ -8544,8 +9090,8 @@ function PluginSettingsPanel({
|
|
|
8544
9090
|
}
|
|
8545
9091
|
)
|
|
8546
9092
|
] }),
|
|
8547
|
-
/* @__PURE__ */ (0,
|
|
8548
|
-
/* @__PURE__ */ (0,
|
|
9093
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Button, { size: "sm", onClick: handleSave, disabled: saving, className: "gap-1", children: [
|
|
9094
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Save, { className: "h-3.5 w-3.5" }),
|
|
8549
9095
|
"Save"
|
|
8550
9096
|
] })
|
|
8551
9097
|
] });
|
|
@@ -8556,28 +9102,28 @@ function PluginListItem({
|
|
|
8556
9102
|
selected,
|
|
8557
9103
|
onSelect
|
|
8558
9104
|
}) {
|
|
8559
|
-
return /* @__PURE__ */ (0,
|
|
9105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8560
9106
|
"button",
|
|
8561
9107
|
{
|
|
8562
9108
|
type: "button",
|
|
8563
9109
|
onClick: onSelect,
|
|
8564
9110
|
className: `flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors ${selected ? "border-gray-300 bg-gray-50 dark:border-gray-600 dark:bg-gray-700/50" : "border-transparent hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,
|
|
8565
9111
|
children: [
|
|
8566
|
-
/* @__PURE__ */ (0,
|
|
8567
|
-
/* @__PURE__ */ (0,
|
|
8568
|
-
/* @__PURE__ */ (0,
|
|
8569
|
-
/* @__PURE__ */ (0,
|
|
8570
|
-
/* @__PURE__ */ (0,
|
|
9112
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PluginIcon, { descriptor, size: "sm" }),
|
|
9113
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: descriptor.label || descriptor.name }),
|
|
9115
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
9116
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
8571
9117
|
"span",
|
|
8572
9118
|
{
|
|
8573
9119
|
className: `inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-xs font-medium ${enabled ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}`,
|
|
8574
9120
|
children: [
|
|
8575
|
-
enabled ? /* @__PURE__ */ (0,
|
|
9121
|
+
enabled ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.CheckCircle2, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.XCircle, { className: "h-3 w-3" }),
|
|
8576
9122
|
enabled ? "On" : "Off"
|
|
8577
9123
|
]
|
|
8578
9124
|
}
|
|
8579
9125
|
),
|
|
8580
|
-
/* @__PURE__ */ (0,
|
|
9126
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: [
|
|
8581
9127
|
"v",
|
|
8582
9128
|
descriptor.version
|
|
8583
9129
|
] })
|
|
@@ -8609,16 +9155,16 @@ function PluginsPage() {
|
|
|
8609
9155
|
).catch(() => {
|
|
8610
9156
|
});
|
|
8611
9157
|
};
|
|
8612
|
-
return /* @__PURE__ */ (0,
|
|
8613
|
-
/* @__PURE__ */ (0,
|
|
8614
|
-
/* @__PURE__ */ (0,
|
|
8615
|
-
/* @__PURE__ */ (0,
|
|
9158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "bg-gray-800 border-b border-gray-700 px-4 py-2.5 rounded-t-lg dark:bg-gray-900 dark:border-gray-700", children: [
|
|
9160
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h1", { className: "text-base font-semibold text-white", children: "Plugins" }),
|
|
9161
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-xs text-gray-300 mt-0.5", children: "Registered plugins and their status" })
|
|
8616
9162
|
] }),
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8618
|
-
/* @__PURE__ */ (0,
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8620
|
-
] }) : /* @__PURE__ */ (0,
|
|
8621
|
-
/* @__PURE__ */ (0,
|
|
9163
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "min-w-0 p-6", children: pluginDescriptors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "py-12 text-center", children: [
|
|
9164
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "mx-auto h-10 w-10 text-gray-400" }),
|
|
9165
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No plugins registered. Add plugin descriptors to your app admin layout." })
|
|
9166
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex gap-6", children: [
|
|
9167
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "w-56 shrink-0 space-y-1", children: pluginDescriptors.map((p) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8622
9168
|
PluginListItem,
|
|
8623
9169
|
{
|
|
8624
9170
|
descriptor: p,
|
|
@@ -8628,24 +9174,24 @@ function PluginsPage() {
|
|
|
8628
9174
|
},
|
|
8629
9175
|
p.name
|
|
8630
9176
|
)) }),
|
|
8631
|
-
/* @__PURE__ */ (0,
|
|
8632
|
-
/* @__PURE__ */ (0,
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8634
|
-
] }) : /* @__PURE__ */ (0,
|
|
8635
|
-
/* @__PURE__ */ (0,
|
|
9177
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "min-w-0 flex-1", children: !selectedName ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
9178
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
9179
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a plugin to view or edit its configuration." })
|
|
9180
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: selectedDescriptor?.settingsGroup ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
9181
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-4", children: [
|
|
8636
9182
|
selectedDescriptor.label || selectedDescriptor.name,
|
|
8637
9183
|
" \u2014 Configuration"
|
|
8638
9184
|
] }),
|
|
8639
|
-
/* @__PURE__ */ (0,
|
|
9185
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8640
9186
|
PluginSettingsPanel,
|
|
8641
9187
|
{
|
|
8642
9188
|
descriptor: selectedDescriptor,
|
|
8643
9189
|
onSaved: () => refreshEnabled(selectedDescriptor.name)
|
|
8644
9190
|
}
|
|
8645
9191
|
)
|
|
8646
|
-
] }) : /* @__PURE__ */ (0,
|
|
8647
|
-
/* @__PURE__ */ (0,
|
|
8648
|
-
/* @__PURE__ */ (0,
|
|
9192
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
9193
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react32.Puzzle, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
9194
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No configuration available for this plugin." })
|
|
8649
9195
|
] }) }) })
|
|
8650
9196
|
] }) })
|
|
8651
9197
|
] });
|
|
@@ -8654,48 +9200,48 @@ function PluginsPage() {
|
|
|
8654
9200
|
// src/admin/pages/BrandEditPage.tsx
|
|
8655
9201
|
var import_react41 = require("react");
|
|
8656
9202
|
var import_navigation16 = require("next/navigation");
|
|
8657
|
-
var
|
|
9203
|
+
var import_lucide_react33 = require("lucide-react");
|
|
8658
9204
|
|
|
8659
9205
|
// src/components/Admin/SeoSection.tsx
|
|
8660
|
-
var
|
|
9206
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8661
9207
|
function SeoSection({
|
|
8662
9208
|
values,
|
|
8663
9209
|
onChange
|
|
8664
9210
|
}) {
|
|
8665
9211
|
const inputCls3 = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm h-8";
|
|
8666
9212
|
const textareaCls = "w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm min-h-[60px]";
|
|
8667
|
-
return /* @__PURE__ */ (0,
|
|
8668
|
-
/* @__PURE__ */ (0,
|
|
8669
|
-
/* @__PURE__ */ (0,
|
|
8670
|
-
/* @__PURE__ */ (0,
|
|
8671
|
-
/* @__PURE__ */ (0,
|
|
8672
|
-
/* @__PURE__ */ (0,
|
|
9213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "border-t border-gray-200 pt-2", children: [
|
|
9214
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: "SEO" }),
|
|
9215
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "space-y-3", children: [
|
|
9216
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9217
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Title" }),
|
|
9218
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoTitle, onChange: (e) => onChange("seoTitle", e.target.value), className: inputCls3 })
|
|
8673
9219
|
] }),
|
|
8674
|
-
/* @__PURE__ */ (0,
|
|
8675
|
-
/* @__PURE__ */ (0,
|
|
8676
|
-
/* @__PURE__ */ (0,
|
|
9220
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9221
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Meta Description" }),
|
|
9222
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("textarea", { value: values.seoDescription, onChange: (e) => onChange("seoDescription", e.target.value), className: textareaCls, rows: 2 })
|
|
8677
9223
|
] }),
|
|
8678
|
-
/* @__PURE__ */ (0,
|
|
8679
|
-
/* @__PURE__ */ (0,
|
|
8680
|
-
/* @__PURE__ */ (0,
|
|
9224
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Keywords" }),
|
|
9226
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoKeywords, onChange: (e) => onChange("seoKeywords", e.target.value), placeholder: "keyword1, keyword2", className: inputCls3 })
|
|
8681
9227
|
] }),
|
|
8682
|
-
/* @__PURE__ */ (0,
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
8684
|
-
/* @__PURE__ */ (0,
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Title" }),
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "text", value: values.seoOgTitle, onChange: (e) => onChange("seoOgTitle", e.target.value), className: inputCls3 })
|
|
8685
9231
|
] }),
|
|
8686
|
-
/* @__PURE__ */ (0,
|
|
8687
|
-
/* @__PURE__ */ (0,
|
|
8688
|
-
/* @__PURE__ */ (0,
|
|
9232
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9233
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Description" }),
|
|
9234
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("textarea", { value: values.seoOgDescription, onChange: (e) => onChange("seoOgDescription", e.target.value), className: textareaCls, rows: 2 })
|
|
8689
9235
|
] }),
|
|
8690
|
-
/* @__PURE__ */ (0,
|
|
8691
|
-
/* @__PURE__ */ (0,
|
|
8692
|
-
/* @__PURE__ */ (0,
|
|
9236
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { children: [
|
|
9237
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "OG Image" }),
|
|
9238
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("input", { type: "url", value: values.seoOgImage, onChange: (e) => onChange("seoOgImage", e.target.value), placeholder: "https://...", className: inputCls3 })
|
|
8693
9239
|
] })
|
|
8694
9240
|
] })
|
|
8695
9241
|
] });
|
|
8696
9242
|
}
|
|
8697
9243
|
async function saveSeo(seo, slug, existingSeoId) {
|
|
8698
|
-
const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords;
|
|
9244
|
+
const hasSeo = seo.seoTitle || seo.seoDescription || seo.seoKeywords || seo.seoOgTitle || seo.seoOgDescription || seo.seoOgImage;
|
|
8699
9245
|
if (!hasSeo) return existingSeoId;
|
|
8700
9246
|
const payload = {
|
|
8701
9247
|
title: seo.seoTitle || null,
|
|
@@ -8745,7 +9291,7 @@ async function fetchSeo(seoId) {
|
|
|
8745
9291
|
}
|
|
8746
9292
|
|
|
8747
9293
|
// src/admin/pages/BrandEditPage.tsx
|
|
8748
|
-
var
|
|
9294
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8749
9295
|
var isCreate = (id) => id === "create";
|
|
8750
9296
|
function BrandEditPage({ brandId }) {
|
|
8751
9297
|
const router = (0, import_navigation16.useRouter)();
|
|
@@ -8831,10 +9377,10 @@ function BrandEditPage({ brandId }) {
|
|
|
8831
9377
|
}
|
|
8832
9378
|
};
|
|
8833
9379
|
if (loading) {
|
|
8834
|
-
return /* @__PURE__ */ (0,
|
|
9380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
8835
9381
|
}
|
|
8836
|
-
return /* @__PURE__ */ (0,
|
|
8837
|
-
/* @__PURE__ */ (0,
|
|
9382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
9383
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8838
9384
|
DetailPageHeader,
|
|
8839
9385
|
{
|
|
8840
9386
|
title: create ? "Add Brand" : "Edit Brand",
|
|
@@ -8846,23 +9392,23 @@ function BrandEditPage({ brandId }) {
|
|
|
8846
9392
|
]
|
|
8847
9393
|
}
|
|
8848
9394
|
),
|
|
8849
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
8850
|
-
/* @__PURE__ */ (0,
|
|
8851
|
-
/* @__PURE__ */ (0,
|
|
8852
|
-
/* @__PURE__ */ (0,
|
|
8853
|
-
/* @__PURE__ */ (0,
|
|
9395
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex", children: [
|
|
9396
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react33.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
9397
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "ml-3", children: [
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: e }, i)) })
|
|
8854
9400
|
] })
|
|
8855
9401
|
] }) }),
|
|
8856
|
-
/* @__PURE__ */ (0,
|
|
9402
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8857
9403
|
DetailPageLayout,
|
|
8858
9404
|
{
|
|
8859
|
-
main: /* @__PURE__ */ (0,
|
|
8860
|
-
/* @__PURE__ */ (0,
|
|
8861
|
-
/* @__PURE__ */ (0,
|
|
8862
|
-
/* @__PURE__ */ (0,
|
|
8863
|
-
/* @__PURE__ */ (0,
|
|
8864
|
-
/* @__PURE__ */ (0,
|
|
8865
|
-
/* @__PURE__ */ (0,
|
|
9405
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
9406
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9407
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
|
|
9408
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50 space-y-4", children: [
|
|
9409
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Name *" }),
|
|
9411
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8866
9412
|
"input",
|
|
8867
9413
|
{
|
|
8868
9414
|
type: "text",
|
|
@@ -8873,9 +9419,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8873
9419
|
}
|
|
8874
9420
|
)
|
|
8875
9421
|
] }),
|
|
8876
|
-
/* @__PURE__ */ (0,
|
|
8877
|
-
/* @__PURE__ */ (0,
|
|
8878
|
-
/* @__PURE__ */ (0,
|
|
9422
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9423
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Slug *" }),
|
|
9424
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8879
9425
|
"input",
|
|
8880
9426
|
{
|
|
8881
9427
|
type: "text",
|
|
@@ -8886,9 +9432,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8886
9432
|
}
|
|
8887
9433
|
)
|
|
8888
9434
|
] }),
|
|
8889
|
-
/* @__PURE__ */ (0,
|
|
8890
|
-
/* @__PURE__ */ (0,
|
|
8891
|
-
/* @__PURE__ */ (0,
|
|
9435
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9436
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Description" }),
|
|
9437
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8892
9438
|
"textarea",
|
|
8893
9439
|
{
|
|
8894
9440
|
value: description,
|
|
@@ -8898,9 +9444,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8898
9444
|
}
|
|
8899
9445
|
)
|
|
8900
9446
|
] }),
|
|
8901
|
-
/* @__PURE__ */ (0,
|
|
8902
|
-
/* @__PURE__ */ (0,
|
|
8903
|
-
/* @__PURE__ */ (0,
|
|
9447
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9448
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Logo URL" }),
|
|
9449
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8904
9450
|
"input",
|
|
8905
9451
|
{
|
|
8906
9452
|
type: "url",
|
|
@@ -8910,9 +9456,9 @@ function BrandEditPage({ brandId }) {
|
|
|
8910
9456
|
}
|
|
8911
9457
|
)
|
|
8912
9458
|
] }),
|
|
8913
|
-
/* @__PURE__ */ (0,
|
|
8914
|
-
/* @__PURE__ */ (0,
|
|
8915
|
-
/* @__PURE__ */ (0,
|
|
9459
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { children: [
|
|
9460
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "Sort order" }),
|
|
9461
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8916
9462
|
"input",
|
|
8917
9463
|
{
|
|
8918
9464
|
type: "number",
|
|
@@ -8924,15 +9470,15 @@ function BrandEditPage({ brandId }) {
|
|
|
8924
9470
|
] })
|
|
8925
9471
|
] })
|
|
8926
9472
|
] }),
|
|
8927
|
-
/* @__PURE__ */ (0,
|
|
8928
|
-
/* @__PURE__ */ (0,
|
|
8929
|
-
/* @__PURE__ */ (0,
|
|
9473
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9474
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
8930
9476
|
] })
|
|
8931
9477
|
] }),
|
|
8932
|
-
sidebar: /* @__PURE__ */ (0,
|
|
8933
|
-
/* @__PURE__ */ (0,
|
|
8934
|
-
/* @__PURE__ */ (0,
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
9478
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("section", { children: [
|
|
9479
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
|
|
9480
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
9481
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
8936
9482
|
"input",
|
|
8937
9483
|
{
|
|
8938
9484
|
type: "checkbox",
|
|
@@ -8941,7 +9487,7 @@ function BrandEditPage({ brandId }) {
|
|
|
8941
9487
|
className: "h-4 w-4 rounded border-gray-300"
|
|
8942
9488
|
}
|
|
8943
9489
|
),
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
9490
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
|
|
8945
9491
|
] }) })
|
|
8946
9492
|
] }) })
|
|
8947
9493
|
}
|
|
@@ -8952,11 +9498,11 @@ function BrandEditPage({ brandId }) {
|
|
|
8952
9498
|
// src/admin/pages/ProductEditPage.tsx
|
|
8953
9499
|
var import_react43 = require("react");
|
|
8954
9500
|
var import_navigation17 = require("next/navigation");
|
|
8955
|
-
var
|
|
9501
|
+
var import_lucide_react34 = require("lucide-react");
|
|
8956
9502
|
|
|
8957
9503
|
// src/components/Admin/AttributeFacetNameInput.tsx
|
|
8958
9504
|
var import_react42 = require("react");
|
|
8959
|
-
var
|
|
9505
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8960
9506
|
function slugFromName(name) {
|
|
8961
9507
|
const s = name.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
8962
9508
|
return s || "attribute";
|
|
@@ -9024,8 +9570,8 @@ function AttributeFacetNameInput({
|
|
|
9024
9570
|
}
|
|
9025
9571
|
};
|
|
9026
9572
|
const exactMatch = list.some((x) => x.name.toLowerCase() === draft.trim().toLowerCase());
|
|
9027
|
-
return /* @__PURE__ */ (0,
|
|
9028
|
-
/* @__PURE__ */ (0,
|
|
9573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
9574
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9029
9575
|
"input",
|
|
9030
9576
|
{
|
|
9031
9577
|
type: "text",
|
|
@@ -9056,8 +9602,8 @@ function AttributeFacetNameInput({
|
|
|
9056
9602
|
className: inputClassName
|
|
9057
9603
|
}
|
|
9058
9604
|
),
|
|
9059
|
-
open && (list.length > 0 || draft.trim() && !exactMatch) && /* @__PURE__ */ (0,
|
|
9060
|
-
list.map((a) => /* @__PURE__ */ (0,
|
|
9605
|
+
open && (list.length > 0 || draft.trim() && !exactMatch) && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("ul", { className: "absolute z-20 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg max-h-48 overflow-auto", children: [
|
|
9606
|
+
list.map((a) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
9061
9607
|
"li",
|
|
9062
9608
|
{
|
|
9063
9609
|
onMouseDown: (e) => {
|
|
@@ -9069,7 +9615,7 @@ function AttributeFacetNameInput({
|
|
|
9069
9615
|
},
|
|
9070
9616
|
a.id
|
|
9071
9617
|
)),
|
|
9072
|
-
draft.trim() && !exactMatch && /* @__PURE__ */ (0,
|
|
9618
|
+
draft.trim() && !exactMatch && /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
9073
9619
|
"li",
|
|
9074
9620
|
{
|
|
9075
9621
|
onMouseDown: (e) => {
|
|
@@ -9089,7 +9635,7 @@ function AttributeFacetNameInput({
|
|
|
9089
9635
|
}
|
|
9090
9636
|
|
|
9091
9637
|
// src/admin/pages/ProductEditPage.tsx
|
|
9092
|
-
var
|
|
9638
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
9093
9639
|
var isCreate2 = (id) => id === "create";
|
|
9094
9640
|
var sectionCls = "min-w-0 overflow-hidden border border-gray-200 rounded-lg p-4 bg-gray-50/50";
|
|
9095
9641
|
var labelCls = "block text-xs font-medium text-gray-600 mb-1";
|
|
@@ -9132,6 +9678,7 @@ function ProductEditPage({ productId }) {
|
|
|
9132
9678
|
const [brands, setBrands] = (0, import_react43.useState)([]);
|
|
9133
9679
|
const [categories, setCategories] = (0, import_react43.useState)([]);
|
|
9134
9680
|
const [name, setName] = (0, import_react43.useState)("");
|
|
9681
|
+
const [productSlug, setProductSlug] = (0, import_react43.useState)("");
|
|
9135
9682
|
const [sku, setSku] = (0, import_react43.useState)("");
|
|
9136
9683
|
const [hsn, setHsn] = (0, import_react43.useState)("");
|
|
9137
9684
|
const [collectionId, setCollectionId] = (0, import_react43.useState)(null);
|
|
@@ -9184,7 +9731,10 @@ function ProductEditPage({ productId }) {
|
|
|
9184
9731
|
if (Array.isArray(d.data)) attrList = d.data;
|
|
9185
9732
|
}
|
|
9186
9733
|
if (create) {
|
|
9187
|
-
if (!cancelled)
|
|
9734
|
+
if (!cancelled) {
|
|
9735
|
+
setProductSlug("");
|
|
9736
|
+
setLoading(false);
|
|
9737
|
+
}
|
|
9188
9738
|
return;
|
|
9189
9739
|
}
|
|
9190
9740
|
const res = await fetch(`/api/products/${productId}`);
|
|
@@ -9192,6 +9742,7 @@ function ProductEditPage({ productId }) {
|
|
|
9192
9742
|
const product = await res.json();
|
|
9193
9743
|
if (cancelled) return;
|
|
9194
9744
|
setName(product.name ?? "");
|
|
9745
|
+
setProductSlug(typeof product.slug === "string" ? product.slug : "");
|
|
9195
9746
|
setSku(product.sku ?? "");
|
|
9196
9747
|
setHsn(product.hsn ?? "");
|
|
9197
9748
|
setCollectionId(product.collectionId ?? null);
|
|
@@ -9247,6 +9798,12 @@ function ProductEditPage({ productId }) {
|
|
|
9247
9798
|
cancelled = true;
|
|
9248
9799
|
};
|
|
9249
9800
|
}, [productId, create]);
|
|
9801
|
+
(0, import_react43.useEffect)(() => {
|
|
9802
|
+
if (!create || !name.trim() || productSlug.trim()) return;
|
|
9803
|
+
setProductSlug(
|
|
9804
|
+
name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "")
|
|
9805
|
+
);
|
|
9806
|
+
}, [create, name, productSlug]);
|
|
9250
9807
|
const handleSave = async () => {
|
|
9251
9808
|
setErrors([]);
|
|
9252
9809
|
if (!name.trim()) {
|
|
@@ -9259,7 +9816,8 @@ function ProductEditPage({ productId }) {
|
|
|
9259
9816
|
}
|
|
9260
9817
|
setSaving(true);
|
|
9261
9818
|
try {
|
|
9262
|
-
const
|
|
9819
|
+
const seoSlug = productSlug.trim() || name.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
9820
|
+
const savedSeoId = await saveSeo(seo, seoSlug, seoId);
|
|
9263
9821
|
const metadata = buildProductMetadata(otherMetadata, { description, images, specifications });
|
|
9264
9822
|
const productPayload = {
|
|
9265
9823
|
name: name.trim(),
|
|
@@ -9287,6 +9845,9 @@ function ProductEditPage({ productId }) {
|
|
|
9287
9845
|
return;
|
|
9288
9846
|
}
|
|
9289
9847
|
const savedProduct = await res.json();
|
|
9848
|
+
if (typeof savedProduct.slug === "string") {
|
|
9849
|
+
setProductSlug(savedProduct.slug);
|
|
9850
|
+
}
|
|
9290
9851
|
const savedId = create ? savedProduct.id : productId;
|
|
9291
9852
|
const slugify = (n) => n.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "attribute";
|
|
9292
9853
|
async function ensureAttributeId(attrName) {
|
|
@@ -9376,10 +9937,10 @@ function ProductEditPage({ productId }) {
|
|
|
9376
9937
|
const removeFacet = (i) => setFacetRows((prev) => prev.length <= 1 ? prev : prev.filter((_, j) => j !== i));
|
|
9377
9938
|
const setFacet = (i, field, value) => setFacetRows((prev) => prev.map((row, j) => j === i ? { ...row, [field]: value } : row));
|
|
9378
9939
|
if (loading) {
|
|
9379
|
-
return /* @__PURE__ */ (0,
|
|
9940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
9380
9941
|
}
|
|
9381
|
-
return /* @__PURE__ */ (0,
|
|
9382
|
-
/* @__PURE__ */ (0,
|
|
9942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
9943
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9383
9944
|
DetailPageHeader,
|
|
9384
9945
|
{
|
|
9385
9946
|
title: create ? "Add Product" : "Edit Product",
|
|
@@ -9391,90 +9952,90 @@ function ProductEditPage({ productId }) {
|
|
|
9391
9952
|
]
|
|
9392
9953
|
}
|
|
9393
9954
|
),
|
|
9394
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
9395
|
-
/* @__PURE__ */ (0,
|
|
9396
|
-
/* @__PURE__ */ (0,
|
|
9397
|
-
/* @__PURE__ */ (0,
|
|
9398
|
-
/* @__PURE__ */ (0,
|
|
9955
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex", children: [
|
|
9956
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
9957
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "ml-3", children: [
|
|
9958
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
9959
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { children: e }, i)) })
|
|
9399
9960
|
] })
|
|
9400
9961
|
] }) }),
|
|
9401
|
-
/* @__PURE__ */ (0,
|
|
9962
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9402
9963
|
DetailPageLayout,
|
|
9403
9964
|
{
|
|
9404
|
-
main: /* @__PURE__ */ (0,
|
|
9405
|
-
/* @__PURE__ */ (0,
|
|
9406
|
-
/* @__PURE__ */ (0,
|
|
9407
|
-
/* @__PURE__ */ (0,
|
|
9408
|
-
/* @__PURE__ */ (0,
|
|
9409
|
-
/* @__PURE__ */ (0,
|
|
9410
|
-
/* @__PURE__ */ (0,
|
|
9965
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
9966
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
9967
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Product details" }),
|
|
9968
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-4`, children: [
|
|
9969
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9970
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Name *" }),
|
|
9971
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls, required: true })
|
|
9411
9972
|
] }),
|
|
9412
|
-
/* @__PURE__ */ (0,
|
|
9413
|
-
/* @__PURE__ */ (0,
|
|
9414
|
-
/* @__PURE__ */ (0,
|
|
9415
|
-
/* @__PURE__ */ (0,
|
|
9973
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9974
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9975
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "SKU" }),
|
|
9976
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: sku, onChange: (e) => setSku(e.target.value), className: inputCls })
|
|
9416
9977
|
] }),
|
|
9417
|
-
/* @__PURE__ */ (0,
|
|
9418
|
-
/* @__PURE__ */ (0,
|
|
9419
|
-
/* @__PURE__ */ (0,
|
|
9978
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9979
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "HSN" }),
|
|
9980
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls })
|
|
9420
9981
|
] })
|
|
9421
9982
|
] }),
|
|
9422
|
-
/* @__PURE__ */ (0,
|
|
9423
|
-
/* @__PURE__ */ (0,
|
|
9424
|
-
/* @__PURE__ */ (0,
|
|
9425
|
-
/* @__PURE__ */ (0,
|
|
9426
|
-
/* @__PURE__ */ (0,
|
|
9427
|
-
brands.map((b) => /* @__PURE__ */ (0,
|
|
9983
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
9984
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9985
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Brand" }),
|
|
9986
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
9987
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
9988
|
+
brands.map((b) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: b.id, children: b.name }, b.id))
|
|
9428
9989
|
] })
|
|
9429
9990
|
] }),
|
|
9430
|
-
/* @__PURE__ */ (0,
|
|
9431
|
-
/* @__PURE__ */ (0,
|
|
9432
|
-
/* @__PURE__ */ (0,
|
|
9433
|
-
/* @__PURE__ */ (0,
|
|
9434
|
-
categories.map((c) => /* @__PURE__ */ (0,
|
|
9991
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
9992
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Category" }),
|
|
9993
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
9994
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
9995
|
+
categories.map((c) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9435
9996
|
] })
|
|
9436
9997
|
] })
|
|
9437
9998
|
] }),
|
|
9438
|
-
/* @__PURE__ */ (0,
|
|
9439
|
-
/* @__PURE__ */ (0,
|
|
9440
|
-
/* @__PURE__ */ (0,
|
|
9441
|
-
/* @__PURE__ */ (0,
|
|
9442
|
-
collections.map((c) => /* @__PURE__ */ (0,
|
|
9999
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10000
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Collection" }),
|
|
10001
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: collectionId ?? "", onChange: (e) => setCollectionId(e.target.value ? Number(e.target.value) : null), className: inputCls, children: [
|
|
10002
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "", children: "None" }),
|
|
10003
|
+
collections.map((c) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9443
10004
|
] })
|
|
9444
10005
|
] }),
|
|
9445
|
-
/* @__PURE__ */ (0,
|
|
9446
|
-
/* @__PURE__ */ (0,
|
|
9447
|
-
/* @__PURE__ */ (0,
|
|
9448
|
-
/* @__PURE__ */ (0,
|
|
10006
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10007
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10008
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Price *" }),
|
|
10009
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: price, onChange: (e) => setPrice(e.target.value), className: inputCls, required: true })
|
|
9449
10010
|
] }),
|
|
9450
|
-
/* @__PURE__ */ (0,
|
|
9451
|
-
/* @__PURE__ */ (0,
|
|
9452
|
-
/* @__PURE__ */ (0,
|
|
10011
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10012
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Compare at price" }),
|
|
10013
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: compareAtPrice, onChange: (e) => setCompareAtPrice(e.target.value), className: inputCls })
|
|
9453
10014
|
] })
|
|
9454
10015
|
] }),
|
|
9455
|
-
/* @__PURE__ */ (0,
|
|
9456
|
-
/* @__PURE__ */ (0,
|
|
9457
|
-
/* @__PURE__ */ (0,
|
|
9458
|
-
/* @__PURE__ */ (0,
|
|
10016
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10017
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10018
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Quantity" }),
|
|
10019
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("input", { type: "number", value: quantity, onChange: (e) => setQuantity(Number(e.target.value) || 0), className: inputCls })
|
|
9459
10020
|
] }),
|
|
9460
|
-
/* @__PURE__ */ (0,
|
|
9461
|
-
/* @__PURE__ */ (0,
|
|
9462
|
-
/* @__PURE__ */ (0,
|
|
9463
|
-
/* @__PURE__ */ (0,
|
|
9464
|
-
/* @__PURE__ */ (0,
|
|
9465
|
-
/* @__PURE__ */ (0,
|
|
9466
|
-
/* @__PURE__ */ (0,
|
|
10021
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { children: [
|
|
10022
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Status" }),
|
|
10023
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("select", { value: status, onChange: (e) => setStatus(e.target.value), className: inputCls, children: [
|
|
10024
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "draft", children: "Draft" }),
|
|
10025
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "available", children: "Available" }),
|
|
10026
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "reserved", children: "Reserved" }),
|
|
10027
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("option", { value: "sold", children: "Sold" })
|
|
9467
10028
|
] })
|
|
9468
10029
|
] })
|
|
9469
10030
|
] })
|
|
9470
10031
|
] })
|
|
9471
10032
|
] }),
|
|
9472
|
-
/* @__PURE__ */ (0,
|
|
9473
|
-
/* @__PURE__ */ (0,
|
|
9474
|
-
/* @__PURE__ */ (0,
|
|
9475
|
-
/* @__PURE__ */ (0,
|
|
9476
|
-
facetRows.map((row, i) => /* @__PURE__ */ (0,
|
|
9477
|
-
/* @__PURE__ */ (0,
|
|
10033
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10034
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Attributes (facets)" }),
|
|
10035
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs text-gray-500 mb-2", children: "Search existing attributes or create new ones (like blog categories). Value on the right." }),
|
|
10036
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-2`, children: [
|
|
10037
|
+
facetRows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2 items-start", children: [
|
|
10038
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9478
10039
|
AttributeFacetNameInput,
|
|
9479
10040
|
{
|
|
9480
10041
|
value: row.name,
|
|
@@ -9482,7 +10043,7 @@ function ProductEditPage({ productId }) {
|
|
|
9482
10043
|
inputClassName: inputCls
|
|
9483
10044
|
}
|
|
9484
10045
|
),
|
|
9485
|
-
/* @__PURE__ */ (0,
|
|
10046
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9486
10047
|
"input",
|
|
9487
10048
|
{
|
|
9488
10049
|
type: "text",
|
|
@@ -9492,21 +10053,21 @@ function ProductEditPage({ productId }) {
|
|
|
9492
10053
|
className: `${inputCls} flex-1 min-w-[120px]`
|
|
9493
10054
|
}
|
|
9494
10055
|
),
|
|
9495
|
-
/* @__PURE__ */ (0,
|
|
10056
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeFacet(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0 mt-0.5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9496
10057
|
] }, i)),
|
|
9497
|
-
/* @__PURE__ */ (0,
|
|
9498
|
-
/* @__PURE__ */ (0,
|
|
10058
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("button", { type: "button", onClick: addFacet, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
|
|
10059
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9499
10060
|
" Add attribute"
|
|
9500
10061
|
] })
|
|
9501
10062
|
] })
|
|
9502
10063
|
] }),
|
|
9503
|
-
/* @__PURE__ */ (0,
|
|
9504
|
-
/* @__PURE__ */ (0,
|
|
9505
|
-
/* @__PURE__ */ (0,
|
|
9506
|
-
images.map((row, i) => /* @__PURE__ */ (0,
|
|
9507
|
-
/* @__PURE__ */ (0,
|
|
9508
|
-
/* @__PURE__ */ (0,
|
|
9509
|
-
/* @__PURE__ */ (0,
|
|
10064
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10065
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Media" }),
|
|
10066
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-3`, children: [
|
|
10067
|
+
images.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex flex-wrap items-start gap-2 p-2 bg-white rounded border border-gray-200", children: [
|
|
10068
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 min-w-[200px]", children: [
|
|
10069
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Image URL" }),
|
|
10070
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9510
10071
|
"input",
|
|
9511
10072
|
{
|
|
9512
10073
|
type: "url",
|
|
@@ -9517,9 +10078,9 @@ function ProductEditPage({ productId }) {
|
|
|
9517
10078
|
}
|
|
9518
10079
|
)
|
|
9519
10080
|
] }),
|
|
9520
|
-
/* @__PURE__ */ (0,
|
|
9521
|
-
/* @__PURE__ */ (0,
|
|
9522
|
-
/* @__PURE__ */ (0,
|
|
10081
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex-1 min-w-[120px]", children: [
|
|
10082
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { className: labelCls, children: "Alt text" }),
|
|
10083
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9523
10084
|
"input",
|
|
9524
10085
|
{
|
|
9525
10086
|
type: "text",
|
|
@@ -9529,27 +10090,27 @@ function ProductEditPage({ productId }) {
|
|
|
9529
10090
|
}
|
|
9530
10091
|
)
|
|
9531
10092
|
] }),
|
|
9532
|
-
/* @__PURE__ */ (0,
|
|
10093
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9533
10094
|
"button",
|
|
9534
10095
|
{
|
|
9535
10096
|
type: "button",
|
|
9536
10097
|
onClick: () => setDefaultImage(i),
|
|
9537
10098
|
title: "Set as default",
|
|
9538
10099
|
className: "mt-6 p-2 rounded border border-gray-300 hover:bg-gray-100",
|
|
9539
|
-
children: /* @__PURE__ */ (0,
|
|
10100
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Star, { className: `h-4 w-4 ${row.isDefault ? "fill-amber-400 text-amber-500" : "text-gray-400"}` })
|
|
9540
10101
|
}
|
|
9541
10102
|
),
|
|
9542
|
-
/* @__PURE__ */ (0,
|
|
10103
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeImage(i), className: "mt-6 p-2 text-gray-400 hover:text-red-600 rounded", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9543
10104
|
] }, i)),
|
|
9544
|
-
/* @__PURE__ */ (0,
|
|
9545
|
-
/* @__PURE__ */ (0,
|
|
10105
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("button", { type: "button", onClick: addImage, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
|
|
10106
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9546
10107
|
" Add image"
|
|
9547
10108
|
] })
|
|
9548
10109
|
] })
|
|
9549
10110
|
] }),
|
|
9550
|
-
/* @__PURE__ */ (0,
|
|
9551
|
-
/* @__PURE__ */ (0,
|
|
9552
|
-
/* @__PURE__ */ (0,
|
|
10111
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10112
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Description" }),
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: sectionCls, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9553
10114
|
"textarea",
|
|
9554
10115
|
{
|
|
9555
10116
|
value: description,
|
|
@@ -9560,11 +10121,11 @@ function ProductEditPage({ productId }) {
|
|
|
9560
10121
|
}
|
|
9561
10122
|
) })
|
|
9562
10123
|
] }),
|
|
9563
|
-
/* @__PURE__ */ (0,
|
|
9564
|
-
/* @__PURE__ */ (0,
|
|
9565
|
-
/* @__PURE__ */ (0,
|
|
9566
|
-
specifications.map((row, i) => /* @__PURE__ */ (0,
|
|
9567
|
-
/* @__PURE__ */ (0,
|
|
10124
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10125
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Specifications" }),
|
|
10126
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: `${sectionCls} space-y-2`, children: [
|
|
10127
|
+
specifications.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "flex gap-2", children: [
|
|
10128
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9568
10129
|
"input",
|
|
9569
10130
|
{
|
|
9570
10131
|
type: "text",
|
|
@@ -9574,7 +10135,7 @@ function ProductEditPage({ productId }) {
|
|
|
9574
10135
|
className: `${inputCls} flex-1`
|
|
9575
10136
|
}
|
|
9576
10137
|
),
|
|
9577
|
-
/* @__PURE__ */ (0,
|
|
10138
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
9578
10139
|
"input",
|
|
9579
10140
|
{
|
|
9580
10141
|
type: "text",
|
|
@@ -9584,18 +10145,18 @@ function ProductEditPage({ productId }) {
|
|
|
9584
10145
|
className: `${inputCls} flex-1`
|
|
9585
10146
|
}
|
|
9586
10147
|
),
|
|
9587
|
-
/* @__PURE__ */ (0,
|
|
10148
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("button", { type: "button", onClick: () => removeSpec(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Trash2, { className: "h-4 w-4" }) })
|
|
9588
10149
|
] }, i)),
|
|
9589
|
-
/* @__PURE__ */ (0,
|
|
9590
|
-
/* @__PURE__ */ (0,
|
|
10150
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("button", { type: "button", onClick: addSpec, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
|
|
10151
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_lucide_react34.Plus, { className: "h-3.5 w-3.5" }),
|
|
9591
10152
|
" Add row"
|
|
9592
10153
|
] })
|
|
9593
10154
|
] })
|
|
9594
10155
|
] })
|
|
9595
10156
|
] }),
|
|
9596
|
-
sidebar: /* @__PURE__ */ (0,
|
|
9597
|
-
/* @__PURE__ */ (0,
|
|
9598
|
-
/* @__PURE__ */ (0,
|
|
10157
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { children: [
|
|
10158
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
10159
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: sectionCls, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
9599
10160
|
] })
|
|
9600
10161
|
}
|
|
9601
10162
|
)
|
|
@@ -9605,8 +10166,8 @@ function ProductEditPage({ productId }) {
|
|
|
9605
10166
|
// src/admin/pages/CollectionEditPage.tsx
|
|
9606
10167
|
var import_react44 = require("react");
|
|
9607
10168
|
var import_navigation18 = require("next/navigation");
|
|
9608
|
-
var
|
|
9609
|
-
var
|
|
10169
|
+
var import_lucide_react35 = require("lucide-react");
|
|
10170
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
9610
10171
|
var isCreate3 = (id) => id === "create";
|
|
9611
10172
|
var emptySlide = () => ({ url: "", type: "image", caption: "" });
|
|
9612
10173
|
var emptyVariant = () => ({ name: "", price: "", extraSpecs: [] });
|
|
@@ -9807,10 +10368,10 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9807
10368
|
(v) => v.map((x, j) => j === variantIdx ? { ...x, extraSpecs: x.extraSpecs.filter((_, s) => s !== specIdx) } : x)
|
|
9808
10369
|
);
|
|
9809
10370
|
if (loading) {
|
|
9810
|
-
return /* @__PURE__ */ (0,
|
|
10371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-gray-500", children: "Loading..." }) });
|
|
9811
10372
|
}
|
|
9812
|
-
return /* @__PURE__ */ (0,
|
|
9813
|
-
/* @__PURE__ */ (0,
|
|
10373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "rounded-lg bg-white shadow-md", children: [
|
|
10374
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9814
10375
|
DetailPageHeader,
|
|
9815
10376
|
{
|
|
9816
10377
|
title: create ? "Add Collection" : "Edit Collection",
|
|
@@ -9822,137 +10383,137 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9822
10383
|
]
|
|
9823
10384
|
}
|
|
9824
10385
|
),
|
|
9825
|
-
errors.length > 0 && /* @__PURE__ */ (0,
|
|
9826
|
-
/* @__PURE__ */ (0,
|
|
9827
|
-
/* @__PURE__ */ (0,
|
|
9828
|
-
/* @__PURE__ */ (0,
|
|
9829
|
-
/* @__PURE__ */ (0,
|
|
10386
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "bg-red-50 border-l-4 border-red-400 p-4 mx-6 mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex", children: [
|
|
10387
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.AlertCircle, { className: "h-5 w-5 text-red-400 flex-shrink-0" }),
|
|
10388
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "ml-3", children: [
|
|
10389
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-sm font-medium text-red-800", children: "Please fix the following errors:" }),
|
|
10390
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: "mt-2 text-sm text-red-700 list-disc pl-5 space-y-1", children: errors.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("li", { children: e }, i)) })
|
|
9830
10391
|
] })
|
|
9831
10392
|
] }) }),
|
|
9832
|
-
/* @__PURE__ */ (0,
|
|
10393
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
9833
10394
|
DetailPageLayout,
|
|
9834
10395
|
{
|
|
9835
|
-
main: /* @__PURE__ */ (0,
|
|
9836
|
-
/* @__PURE__ */ (0,
|
|
9837
|
-
/* @__PURE__ */ (0,
|
|
9838
|
-
/* @__PURE__ */ (0,
|
|
9839
|
-
/* @__PURE__ */ (0,
|
|
9840
|
-
/* @__PURE__ */ (0,
|
|
9841
|
-
/* @__PURE__ */ (0,
|
|
10396
|
+
main: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10397
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10398
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Basic info" }),
|
|
10399
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: `${sectionCls2} space-y-4`, children: [
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10401
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Name *" }),
|
|
10402
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: name, onChange: (e) => setName(e.target.value), className: inputCls2, required: true })
|
|
9842
10403
|
] }),
|
|
9843
|
-
/* @__PURE__ */ (0,
|
|
9844
|
-
/* @__PURE__ */ (0,
|
|
9845
|
-
/* @__PURE__ */ (0,
|
|
10404
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10405
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Slug *" }),
|
|
10406
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: slug, onChange: (e) => setSlug(e.target.value), className: inputCls2, required: true })
|
|
9846
10407
|
] }),
|
|
9847
|
-
/* @__PURE__ */ (0,
|
|
9848
|
-
/* @__PURE__ */ (0,
|
|
9849
|
-
/* @__PURE__ */ (0,
|
|
10408
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10409
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "HSN" }),
|
|
10410
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: hsn, onChange: (e) => setHsn(e.target.value), className: inputCls2 })
|
|
9850
10411
|
] }),
|
|
9851
|
-
/* @__PURE__ */ (0,
|
|
9852
|
-
/* @__PURE__ */ (0,
|
|
9853
|
-
/* @__PURE__ */ (0,
|
|
9854
|
-
/* @__PURE__ */ (0,
|
|
9855
|
-
/* @__PURE__ */ (0,
|
|
9856
|
-
categories.map((c) => /* @__PURE__ */ (0,
|
|
10412
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10413
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10414
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Category" }),
|
|
10415
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: categoryId ?? "", onChange: (e) => setCategoryId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
|
|
10416
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "", children: "None" }),
|
|
10417
|
+
categories.map((c) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: c.id, children: c.name }, c.id))
|
|
9857
10418
|
] })
|
|
9858
10419
|
] }),
|
|
9859
|
-
/* @__PURE__ */ (0,
|
|
9860
|
-
/* @__PURE__ */ (0,
|
|
9861
|
-
/* @__PURE__ */ (0,
|
|
9862
|
-
/* @__PURE__ */ (0,
|
|
9863
|
-
brands.map((b) => /* @__PURE__ */ (0,
|
|
10420
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10421
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Brand" }),
|
|
10422
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: brandId ?? "", onChange: (e) => setBrandId(e.target.value ? Number(e.target.value) : null), className: inputCls2, children: [
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "", children: "None" }),
|
|
10424
|
+
brands.map((b) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: b.id, children: b.name }, b.id))
|
|
9864
10425
|
] })
|
|
9865
10426
|
] })
|
|
9866
10427
|
] }),
|
|
9867
|
-
/* @__PURE__ */ (0,
|
|
9868
|
-
/* @__PURE__ */ (0,
|
|
9869
|
-
/* @__PURE__ */ (0,
|
|
10428
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10429
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Description" }),
|
|
10430
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("textarea", { value: description, onChange: (e) => setDescription(e.target.value), className: `${inputCls2} min-h-[80px]`, rows: 3 })
|
|
9870
10431
|
] }),
|
|
9871
|
-
/* @__PURE__ */ (0,
|
|
9872
|
-
/* @__PURE__ */ (0,
|
|
9873
|
-
/* @__PURE__ */ (0,
|
|
10432
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10433
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Cover image URL" }),
|
|
10434
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: image, onChange: (e) => setImage(e.target.value), className: inputCls2, placeholder: "https://..." })
|
|
9874
10435
|
] }),
|
|
9875
|
-
/* @__PURE__ */ (0,
|
|
9876
|
-
/* @__PURE__ */ (0,
|
|
9877
|
-
/* @__PURE__ */ (0,
|
|
10436
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { children: [
|
|
10437
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Sort order" }),
|
|
10438
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "number", value: sortOrder, onChange: (e) => setSortOrder(Number(e.target.value) || 0), className: inputCls2, style: { width: "6rem" } })
|
|
9878
10439
|
] })
|
|
9879
10440
|
] })
|
|
9880
10441
|
] }),
|
|
9881
|
-
/* @__PURE__ */ (0,
|
|
9882
|
-
/* @__PURE__ */ (0,
|
|
10442
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10443
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
9883
10444
|
"button",
|
|
9884
10445
|
{
|
|
9885
10446
|
type: "button",
|
|
9886
10447
|
onClick: () => setAdvancedOpen((o) => !o),
|
|
9887
10448
|
className: "flex items-center gap-2 w-full text-left text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2",
|
|
9888
10449
|
children: [
|
|
9889
|
-
advancedOpen ? /* @__PURE__ */ (0,
|
|
10450
|
+
advancedOpen ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.ChevronUp, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.ChevronDown, { className: "h-4 w-4" }),
|
|
9890
10451
|
"Advanced page content"
|
|
9891
10452
|
]
|
|
9892
10453
|
}
|
|
9893
10454
|
),
|
|
9894
|
-
advancedOpen && /* @__PURE__ */ (0,
|
|
9895
|
-
/* @__PURE__ */ (0,
|
|
9896
|
-
/* @__PURE__ */ (0,
|
|
9897
|
-
heroSlides.map((slide, i) => /* @__PURE__ */ (0,
|
|
9898
|
-
/* @__PURE__ */ (0,
|
|
9899
|
-
/* @__PURE__ */ (0,
|
|
9900
|
-
/* @__PURE__ */ (0,
|
|
9901
|
-
/* @__PURE__ */ (0,
|
|
10455
|
+
advancedOpen && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "space-y-4", children: [
|
|
10456
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10457
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Hero carousel" }),
|
|
10458
|
+
heroSlides.map((slide, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-wrap gap-2 mb-3 p-2 bg-white rounded border", children: [
|
|
10459
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: slide.url, onChange: (e) => updateHeroSlide(i, "url", e.target.value), placeholder: "Media URL", className: `${inputCls2} flex-1 min-w-[200px]` }),
|
|
10460
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("select", { value: slide.type, onChange: (e) => updateHeroSlide(i, "type", e.target.value), className: `${inputCls2} w-24`, children: [
|
|
10461
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "image", children: "Image" }),
|
|
10462
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("option", { value: "video", children: "Video" })
|
|
9902
10463
|
] }),
|
|
9903
|
-
/* @__PURE__ */ (0,
|
|
9904
|
-
/* @__PURE__ */ (0,
|
|
10464
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: slide.caption, onChange: (e) => updateHeroSlide(i, "caption", e.target.value), placeholder: "Caption", className: `${inputCls2} flex-1 min-w-[120px]` }),
|
|
10465
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeHeroSlide(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9905
10466
|
] }, i)),
|
|
9906
|
-
/* @__PURE__ */ (0,
|
|
9907
|
-
/* @__PURE__ */ (0,
|
|
10467
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("button", { type: "button", onClick: addHeroSlide, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3.5 w-3.5" }),
|
|
9908
10469
|
" Add slide"
|
|
9909
10470
|
] })
|
|
9910
10471
|
] }),
|
|
9911
|
-
/* @__PURE__ */ (0,
|
|
9912
|
-
/* @__PURE__ */ (0,
|
|
9913
|
-
variants.map((v, i) => /* @__PURE__ */ (0,
|
|
9914
|
-
/* @__PURE__ */ (0,
|
|
9915
|
-
/* @__PURE__ */ (0,
|
|
9916
|
-
/* @__PURE__ */ (0,
|
|
9917
|
-
/* @__PURE__ */ (0,
|
|
10472
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10473
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { className: "text-xs font-medium text-gray-700 mb-2", children: "Variants" }),
|
|
10474
|
+
variants.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "mb-4 p-3 bg-white rounded border space-y-2", children: [
|
|
10475
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-2", children: [
|
|
10476
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: v.name, onChange: (e) => updateVariant(i, "name", e.target.value), placeholder: "Name", className: `${inputCls2} w-40` }),
|
|
10477
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "number", value: v.price, onChange: (e) => updateVariant(i, "price", e.target.value), placeholder: "Price", className: `${inputCls2} w-28` }),
|
|
10478
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeVariant(i), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9918
10479
|
] }),
|
|
9919
|
-
v.extraSpecs.map((s, si) => /* @__PURE__ */ (0,
|
|
9920
|
-
/* @__PURE__ */ (0,
|
|
9921
|
-
/* @__PURE__ */ (0,
|
|
9922
|
-
/* @__PURE__ */ (0,
|
|
10480
|
+
v.extraSpecs.map((s, si) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex gap-2", children: [
|
|
10481
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: s.key, onChange: (e) => updateVariantExtraSpec(i, si, "key", e.target.value), placeholder: "Key", className: `${inputCls2} flex-1` }),
|
|
10482
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "text", value: s.value, onChange: (e) => updateVariantExtraSpec(i, si, "value", e.target.value), placeholder: "Value", className: `${inputCls2} flex-1` }),
|
|
10483
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("button", { type: "button", onClick: () => removeVariantExtraSpec(i, si), className: "p-2 text-gray-400 hover:text-red-600 rounded shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Trash2, { className: "h-4 w-4" }) })
|
|
9923
10484
|
] }, si)),
|
|
9924
|
-
/* @__PURE__ */ (0,
|
|
9925
|
-
/* @__PURE__ */ (0,
|
|
10485
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("button", { type: "button", onClick: () => addVariantExtraSpec(i), className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-50", children: [
|
|
10486
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3 w-3" }),
|
|
9926
10487
|
" Add spec"
|
|
9927
10488
|
] })
|
|
9928
10489
|
] }, i)),
|
|
9929
|
-
/* @__PURE__ */ (0,
|
|
9930
|
-
/* @__PURE__ */ (0,
|
|
10490
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("button", { type: "button", onClick: addVariant, className: "inline-flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-50", children: [
|
|
10491
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react35.Plus, { className: "h-3.5 w-3.5" }),
|
|
9931
10492
|
" Add variant"
|
|
9932
10493
|
] })
|
|
9933
10494
|
] }),
|
|
9934
|
-
/* @__PURE__ */ (0,
|
|
9935
|
-
/* @__PURE__ */ (0,
|
|
9936
|
-
/* @__PURE__ */ (0,
|
|
10495
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10496
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Experience description" }),
|
|
10497
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("textarea", { value: experienceDescription, onChange: (e) => setExperienceDescription(e.target.value), className: `${inputCls2} min-h-[60px]`, rows: 2, placeholder: "Optional" })
|
|
9937
10498
|
] }),
|
|
9938
|
-
/* @__PURE__ */ (0,
|
|
9939
|
-
/* @__PURE__ */ (0,
|
|
9940
|
-
/* @__PURE__ */ (0,
|
|
10499
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: sectionCls2, children: [
|
|
10500
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("label", { className: labelCls2, children: "Brochure URL" }),
|
|
10501
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "url", value: brochureUrl, onChange: (e) => setBrochureUrl(e.target.value), className: inputCls2, placeholder: "https://..." })
|
|
9941
10502
|
] })
|
|
9942
10503
|
] })
|
|
9943
10504
|
] })
|
|
9944
10505
|
] }),
|
|
9945
|
-
sidebar: /* @__PURE__ */ (0,
|
|
9946
|
-
/* @__PURE__ */ (0,
|
|
9947
|
-
/* @__PURE__ */ (0,
|
|
9948
|
-
/* @__PURE__ */ (0,
|
|
9949
|
-
/* @__PURE__ */ (0,
|
|
9950
|
-
/* @__PURE__ */ (0,
|
|
10506
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
|
|
10507
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10508
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "Status" }),
|
|
10509
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: sectionCls2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
10510
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("input", { type: "checkbox", checked: active, onChange: (e) => setActive(e.target.checked), className: "h-4 w-4 rounded border-gray-300" }),
|
|
10511
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-sm font-medium text-gray-900", children: "Active" })
|
|
9951
10512
|
] }) })
|
|
9952
10513
|
] }),
|
|
9953
|
-
/* @__PURE__ */ (0,
|
|
9954
|
-
/* @__PURE__ */ (0,
|
|
9955
|
-
/* @__PURE__ */ (0,
|
|
10514
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { children: [
|
|
10515
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { className: "text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2", children: "SEO" }),
|
|
10516
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: sectionCls2, children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(SeoSection, { values: seo, onChange: (field, value) => setSeo((s) => ({ ...s, [field]: value })) }) })
|
|
9956
10517
|
] })
|
|
9957
10518
|
] })
|
|
9958
10519
|
}
|
|
@@ -9963,7 +10524,7 @@ function CollectionEditPage({ collectionId }) {
|
|
|
9963
10524
|
// src/admin/pages/RolesPage.tsx
|
|
9964
10525
|
var import_react45 = require("react");
|
|
9965
10526
|
var import_react46 = require("next-auth/react");
|
|
9966
|
-
var
|
|
10527
|
+
var import_lucide_react36 = require("lucide-react");
|
|
9967
10528
|
|
|
9968
10529
|
// src/auth/permission-entities.ts
|
|
9969
10530
|
var ADMIN_GROUP_NAME = "Administrator";
|
|
@@ -9972,22 +10533,22 @@ function isSuperAdminGroupName(name) {
|
|
|
9972
10533
|
}
|
|
9973
10534
|
|
|
9974
10535
|
// src/admin/pages/RolesPage.tsx
|
|
9975
|
-
var
|
|
10536
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
9976
10537
|
function RoleListItem({
|
|
9977
10538
|
group,
|
|
9978
10539
|
selected,
|
|
9979
10540
|
onSelect
|
|
9980
10541
|
}) {
|
|
9981
10542
|
const superG = isSuperAdminGroupName(group.name);
|
|
9982
|
-
return /* @__PURE__ */ (0,
|
|
10543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
9983
10544
|
"button",
|
|
9984
10545
|
{
|
|
9985
10546
|
type: "button",
|
|
9986
10547
|
onClick: onSelect,
|
|
9987
10548
|
className: `flex w-full items-center gap-3 rounded-lg border px-3 py-2.5 text-left transition-colors ${selected ? "border-gray-300 bg-gray-50 dark:border-gray-600 dark:bg-gray-700/50" : "border-transparent hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,
|
|
9988
10549
|
children: [
|
|
9989
|
-
/* @__PURE__ */ (0,
|
|
9990
|
-
/* @__PURE__ */ (0,
|
|
10550
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "h-5 w-5 shrink-0 text-gray-500" }),
|
|
10551
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "font-medium text-gray-900 dark:text-white truncate", children: group.name }) })
|
|
9991
10552
|
]
|
|
9992
10553
|
}
|
|
9993
10554
|
);
|
|
@@ -10121,27 +10682,27 @@ function RolesPage() {
|
|
|
10121
10682
|
}
|
|
10122
10683
|
};
|
|
10123
10684
|
if (status === "loading" || loading) {
|
|
10124
|
-
return /* @__PURE__ */ (0,
|
|
10685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex items-center justify-center py-12 text-gray-600", children: "Loading\u2026" });
|
|
10125
10686
|
}
|
|
10126
10687
|
if (!canManage) {
|
|
10127
|
-
return /* @__PURE__ */ (0,
|
|
10688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-gray-600 p-6", children: "You do not have permission to manage roles." });
|
|
10128
10689
|
}
|
|
10129
|
-
return /* @__PURE__ */ (0,
|
|
10130
|
-
/* @__PURE__ */ (0,
|
|
10131
|
-
/* @__PURE__ */ (0,
|
|
10132
|
-
/* @__PURE__ */ (0,
|
|
10690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md dark:bg-gray-800", children: [
|
|
10691
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "rounded-t-lg border-b border-gray-700 bg-gray-800 px-4 py-2.5 dark:border-gray-700 dark:bg-gray-900", children: [
|
|
10692
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("h1", { className: "text-base font-semibold text-white", children: "Roles" }),
|
|
10693
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "mt-0.5 text-xs text-gray-300", children: "Only the Administrator group can open this page. All roles use the matrix for entity access (Administrator also has users / roles plumbing without matrix rows)." })
|
|
10133
10694
|
] }),
|
|
10134
|
-
/* @__PURE__ */ (0,
|
|
10135
|
-
error ? /* @__PURE__ */ (0,
|
|
10136
|
-
/* @__PURE__ */ (0,
|
|
10137
|
-
/* @__PURE__ */ (0,
|
|
10138
|
-
] }) : /* @__PURE__ */ (0,
|
|
10139
|
-
/* @__PURE__ */ (0,
|
|
10140
|
-
groups.map((g) => /* @__PURE__ */ (0,
|
|
10141
|
-
/* @__PURE__ */ (0,
|
|
10142
|
-
/* @__PURE__ */ (0,
|
|
10143
|
-
/* @__PURE__ */ (0,
|
|
10144
|
-
/* @__PURE__ */ (0,
|
|
10695
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "min-w-0 p-6", children: [
|
|
10696
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "py-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm text-red-600 dark:text-red-400", children: error }) }) : groups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "py-12 text-center", children: [
|
|
10697
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "mx-auto h-10 w-10 text-gray-400" }),
|
|
10698
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "No roles yet. Add one below." })
|
|
10699
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex gap-6", children: [
|
|
10700
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "w-56 shrink-0 space-y-1", children: [
|
|
10701
|
+
groups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(RoleListItem, { group: g, selected: selectedId === g.id, onSelect: () => setSelectedId(g.id) }, g.id)),
|
|
10702
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "space-y-2 border-t border-gray-200 pt-3 dark:border-gray-700", children: [
|
|
10703
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Label3, { className: "text-xs text-gray-500", children: "New role" }),
|
|
10704
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex gap-2", children: [
|
|
10705
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10145
10706
|
Input,
|
|
10146
10707
|
{
|
|
10147
10708
|
className: "h-8 text-sm",
|
|
@@ -10151,42 +10712,42 @@ function RolesPage() {
|
|
|
10151
10712
|
onKeyDown: (e) => e.key === "Enter" && createGroup()
|
|
10152
10713
|
}
|
|
10153
10714
|
),
|
|
10154
|
-
/* @__PURE__ */ (0,
|
|
10715
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "shrink-0", onClick: createGroup, children: "Add" })
|
|
10155
10716
|
] })
|
|
10156
10717
|
] })
|
|
10157
10718
|
] }),
|
|
10158
|
-
/* @__PURE__ */ (0,
|
|
10159
|
-
/* @__PURE__ */ (0,
|
|
10160
|
-
/* @__PURE__ */ (0,
|
|
10161
|
-
] }) : /* @__PURE__ */ (0,
|
|
10162
|
-
/* @__PURE__ */ (0,
|
|
10163
|
-
/* @__PURE__ */ (0,
|
|
10719
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "min-w-0 flex-1", children: !selectedId ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
10720
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Shield, { className: "h-10 w-10 text-gray-300 dark:text-gray-600" }),
|
|
10721
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "mt-3 text-sm text-gray-500 dark:text-gray-400", children: "Select a role to view or edit permissions." })
|
|
10722
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "rounded-lg border border-gray-200 bg-gray-50/50 p-5 dark:border-gray-700 dark:bg-gray-800/50", children: [
|
|
10723
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [
|
|
10724
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("h2", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
10164
10725
|
selected?.name,
|
|
10165
10726
|
" \u2014 Permissions"
|
|
10166
10727
|
] }),
|
|
10167
|
-
/* @__PURE__ */ (0,
|
|
10168
|
-
/* @__PURE__ */ (0,
|
|
10728
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { size: "sm", onClick: saveMatrix, disabled: saving, className: "gap-1", children: [
|
|
10729
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Save, { className: "h-3.5 w-3.5" }),
|
|
10169
10730
|
saving ? "Saving\u2026" : "Save"
|
|
10170
10731
|
] }),
|
|
10171
|
-
selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ (0,
|
|
10172
|
-
/* @__PURE__ */ (0,
|
|
10732
|
+
selected && !isSuperAdminGroupName(selected.name) && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Button, { size: "sm", variant: "outline", className: "gap-1 text-red-600", onClick: deleteGroup, children: [
|
|
10733
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_lucide_react36.Trash2, { className: "h-3.5 w-3.5" }),
|
|
10173
10734
|
"Delete role"
|
|
10174
10735
|
] })
|
|
10175
10736
|
] }),
|
|
10176
|
-
entities.length > 0 && /* @__PURE__ */ (0,
|
|
10177
|
-
/* @__PURE__ */ (0,
|
|
10178
|
-
/* @__PURE__ */ (0,
|
|
10179
|
-
/* @__PURE__ */ (0,
|
|
10180
|
-
/* @__PURE__ */ (0,
|
|
10181
|
-
/* @__PURE__ */ (0,
|
|
10182
|
-
/* @__PURE__ */ (0,
|
|
10737
|
+
entities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "overflow-x-auto rounded-md border border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("table", { className: "w-full text-sm", children: [
|
|
10738
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("tr", { className: "border-b bg-gray-50 dark:bg-gray-900/50", children: [
|
|
10739
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-3 text-left font-medium", children: "Resource" }),
|
|
10740
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "C" }),
|
|
10741
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "R" }),
|
|
10742
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "U" }),
|
|
10743
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("th", { className: "p-2", children: "D" })
|
|
10183
10744
|
] }) }),
|
|
10184
|
-
/* @__PURE__ */ (0,
|
|
10745
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("tbody", { children: entities.map((entity) => {
|
|
10185
10746
|
const row = matrix[entity];
|
|
10186
10747
|
if (!row) return null;
|
|
10187
|
-
return /* @__PURE__ */ (0,
|
|
10188
|
-
/* @__PURE__ */ (0,
|
|
10189
|
-
["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ (0,
|
|
10748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50/50 dark:border-gray-700 dark:hover:bg-gray-800/30", children: [
|
|
10749
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { className: "p-3 font-mono text-xs", children: entity }),
|
|
10750
|
+
["canCreate", "canRead", "canUpdate", "canDelete"].map((k) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { className: "p-2 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
10190
10751
|
"input",
|
|
10191
10752
|
{
|
|
10192
10753
|
type: "checkbox",
|
|
@@ -10199,9 +10760,9 @@ function RolesPage() {
|
|
|
10199
10760
|
] }) })
|
|
10200
10761
|
] }) })
|
|
10201
10762
|
] }),
|
|
10202
|
-
!error && groups.length === 0 && /* @__PURE__ */ (0,
|
|
10203
|
-
/* @__PURE__ */ (0,
|
|
10204
|
-
/* @__PURE__ */ (0,
|
|
10763
|
+
!error && groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "mt-6 flex max-w-md gap-2", children: [
|
|
10764
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Input, { placeholder: "New role name", value: newName, onChange: (e) => setNewName(e.target.value), onKeyDown: (e) => e.key === "Enter" && createGroup() }),
|
|
10765
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Button, { type: "button", onClick: createGroup, children: "Add role" })
|
|
10205
10766
|
] })
|
|
10206
10767
|
] })
|
|
10207
10768
|
] });
|
|
@@ -10363,7 +10924,7 @@ var STORE_CRUD_CONFIGS = {
|
|
|
10363
10924
|
};
|
|
10364
10925
|
|
|
10365
10926
|
// src/admin/pages/AdminPageResolver.tsx
|
|
10366
|
-
var
|
|
10927
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
10367
10928
|
var PAGE_MAP = {
|
|
10368
10929
|
dashboard: DashboardPage,
|
|
10369
10930
|
signin: SignInPage_default,
|
|
@@ -10488,12 +11049,12 @@ function BlogEditorWrapper({ blogId }) {
|
|
|
10488
11049
|
fetch(`/api/blogs/${blogId}`).then((res) => res.ok ? res.json() : null).then((data) => setBlog(data)).finally(() => setLoading(false));
|
|
10489
11050
|
}, [blogId]);
|
|
10490
11051
|
if (loading) {
|
|
10491
|
-
return /* @__PURE__ */ (0,
|
|
10492
|
-
/* @__PURE__ */ (0,
|
|
10493
|
-
/* @__PURE__ */ (0,
|
|
11052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center justify-center py-8", children: [
|
|
11053
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
|
|
11054
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-2", children: "Loading..." })
|
|
10494
11055
|
] });
|
|
10495
11056
|
}
|
|
10496
|
-
return /* @__PURE__ */ (0,
|
|
11057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BlogEditor, { existingBlog: blog });
|
|
10497
11058
|
}
|
|
10498
11059
|
function AdminPageResolver({ slug }) {
|
|
10499
11060
|
const router = (0, import_navigation19.useRouter)();
|
|
@@ -10505,53 +11066,53 @@ function AdminPageResolver({ slug }) {
|
|
|
10505
11066
|
}
|
|
10506
11067
|
}, [key, router]);
|
|
10507
11068
|
if (key === "layout-settings") {
|
|
10508
|
-
return /* @__PURE__ */ (0,
|
|
10509
|
-
/* @__PURE__ */ (0,
|
|
10510
|
-
/* @__PURE__ */ (0,
|
|
11069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex justify-center py-8", children: [
|
|
11070
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }),
|
|
11071
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "ml-2", children: "Redirecting..." })
|
|
10511
11072
|
] });
|
|
10512
11073
|
}
|
|
10513
11074
|
const Page = PAGE_MAP[key];
|
|
10514
11075
|
if (Page) {
|
|
10515
|
-
return /* @__PURE__ */ (0,
|
|
11076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Page, {});
|
|
10516
11077
|
}
|
|
10517
11078
|
if (key === "form-submissions" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10518
|
-
return /* @__PURE__ */ (0,
|
|
11079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(SubmissionDetailPage, { submissionId: slug[1] });
|
|
10519
11080
|
}
|
|
10520
11081
|
if (key === "orders" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10521
|
-
return /* @__PURE__ */ (0,
|
|
11082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(OrderDetailPage, { orderId: slug[1] });
|
|
10522
11083
|
}
|
|
10523
11084
|
if (key === "payments" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10524
|
-
return /* @__PURE__ */ (0,
|
|
11085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PaymentDetailPage, { paymentId: slug[1] });
|
|
10525
11086
|
}
|
|
10526
11087
|
if (key === "contacts" && slug && slug.length === 3 && slug[2] === "view") {
|
|
10527
|
-
return /* @__PURE__ */ (0,
|
|
11088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ContactDetailPage, { contactId: slug[1] });
|
|
10528
11089
|
}
|
|
10529
11090
|
const crud = { ...CRUD_CONFIGS, ...STORE_CRUD_CONFIGS, ...customCrudConfigs }[key];
|
|
10530
11091
|
if (crud && slug && slug.length >= 2) {
|
|
10531
11092
|
const subPath = slug[1];
|
|
10532
11093
|
const isCreate4 = subPath === "create";
|
|
10533
11094
|
if (key === "blogs") {
|
|
10534
|
-
return /* @__PURE__ */ (0,
|
|
11095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BlogEditorWrapper, { blogId: isCreate4 ? void 0 : subPath });
|
|
10535
11096
|
}
|
|
10536
11097
|
if (key === "forms") {
|
|
10537
|
-
return /* @__PURE__ */ (0,
|
|
11098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(FormBuilder, { formId: isCreate4 ? void 0 : subPath });
|
|
10538
11099
|
}
|
|
10539
11100
|
if (key === "pages") {
|
|
10540
|
-
return /* @__PURE__ */ (0,
|
|
11101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(PageBuilderPage, { pageId: isCreate4 ? void 0 : subPath });
|
|
10541
11102
|
}
|
|
10542
11103
|
if (key === "brands") {
|
|
10543
|
-
return /* @__PURE__ */ (0,
|
|
11104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BrandEditPage, { brandId: subPath });
|
|
10544
11105
|
}
|
|
10545
11106
|
if (key === "products") {
|
|
10546
|
-
return /* @__PURE__ */ (0,
|
|
11107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ProductEditPage, { productId: subPath });
|
|
10547
11108
|
}
|
|
10548
11109
|
if (key === "collections") {
|
|
10549
|
-
return /* @__PURE__ */ (0,
|
|
11110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CollectionEditPage, { collectionId: subPath });
|
|
10550
11111
|
}
|
|
10551
11112
|
}
|
|
10552
11113
|
if (crud) {
|
|
10553
11114
|
if (key === "media") {
|
|
10554
|
-
return /* @__PURE__ */ (0,
|
|
11115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MediaLibraryPage, {});
|
|
10555
11116
|
}
|
|
10556
11117
|
const isContactsWithStore = key === "contacts" && storeEnabled;
|
|
10557
11118
|
const columns = isContactsWithStore ? [
|
|
@@ -10563,7 +11124,7 @@ function AdminPageResolver({ slug }) {
|
|
|
10563
11124
|
() => isContactsWithStore ? { includeSummary: "1" } : void 0,
|
|
10564
11125
|
[isContactsWithStore]
|
|
10565
11126
|
);
|
|
10566
|
-
return /* @__PURE__ */ (0,
|
|
11127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
10567
11128
|
AdminCRUD,
|
|
10568
11129
|
{
|
|
10569
11130
|
title: crud.title,
|
|
@@ -10578,13 +11139,13 @@ function AdminPageResolver({ slug }) {
|
|
|
10578
11139
|
}
|
|
10579
11140
|
);
|
|
10580
11141
|
}
|
|
10581
|
-
return /* @__PURE__ */ (0,
|
|
11142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center justify-center min-h-[50vh]", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-gray-500", children: "Page not found" }) });
|
|
10582
11143
|
}
|
|
10583
11144
|
|
|
10584
11145
|
// src/admin/pages/LayoutSettingsPage.tsx
|
|
10585
11146
|
var import_react48 = require("react");
|
|
10586
|
-
var
|
|
10587
|
-
var
|
|
11147
|
+
var import_lucide_react37 = require("lucide-react");
|
|
11148
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
10588
11149
|
function LayoutSettingsPage() {
|
|
10589
11150
|
const { theme } = (0, import_react48.useContext)(AdminConfigContext);
|
|
10590
11151
|
const [activeTab, setActiveTab] = (0, import_react48.useState)("navbar");
|
|
@@ -10640,29 +11201,29 @@ function LayoutSettingsPage() {
|
|
|
10640
11201
|
props: footerLayout.fields
|
|
10641
11202
|
} : null;
|
|
10642
11203
|
if (loading) {
|
|
10643
|
-
return /* @__PURE__ */ (0,
|
|
11204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "animate-spin rounded-full h-6 w-6 border-2 border-gray-300 border-t-gray-600" }) });
|
|
10644
11205
|
}
|
|
10645
|
-
return /* @__PURE__ */ (0,
|
|
10646
|
-
/* @__PURE__ */ (0,
|
|
10647
|
-
/* @__PURE__ */ (0,
|
|
10648
|
-
/* @__PURE__ */ (0,
|
|
10649
|
-
/* @__PURE__ */ (0,
|
|
11206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "min-w-0 rounded-lg bg-white shadow-md", children: [
|
|
11207
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "bg-gray-800 px-4 py-2.5 rounded-t-lg flex items-center justify-between", children: [
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { children: [
|
|
11209
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("h1", { className: "text-xl font-bold text-white", children: "Layout Settings" }),
|
|
11210
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-xs text-gray-300 mt-0.5", children: "Configure your site navbar and footer" })
|
|
10650
11211
|
] }),
|
|
10651
|
-
/* @__PURE__ */ (0,
|
|
11212
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
10652
11213
|
Button,
|
|
10653
11214
|
{
|
|
10654
11215
|
onClick: handleSave,
|
|
10655
11216
|
disabled: saving,
|
|
10656
11217
|
className: "bg-white text-gray-800 hover:bg-gray-100 border-0 text-xs",
|
|
10657
11218
|
children: [
|
|
10658
|
-
/* @__PURE__ */ (0,
|
|
11219
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react37.Save, { className: "h-4 w-4 mr-2" }),
|
|
10659
11220
|
saving ? "Saving..." : "Save"
|
|
10660
11221
|
]
|
|
10661
11222
|
}
|
|
10662
11223
|
)
|
|
10663
11224
|
] }),
|
|
10664
|
-
/* @__PURE__ */ (0,
|
|
10665
|
-
/* @__PURE__ */ (0,
|
|
11225
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "border-b", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "flex", children: [
|
|
11226
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10666
11227
|
"button",
|
|
10667
11228
|
{
|
|
10668
11229
|
className: `px-4 py-2.5 text-sm font-medium border-b-2 ${activeTab === "navbar" ? "border-gray-800 text-gray-800" : "border-transparent text-gray-500 hover:text-gray-700"}`,
|
|
@@ -10670,7 +11231,7 @@ function LayoutSettingsPage() {
|
|
|
10670
11231
|
children: "Navbar"
|
|
10671
11232
|
}
|
|
10672
11233
|
),
|
|
10673
|
-
/* @__PURE__ */ (0,
|
|
11234
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10674
11235
|
"button",
|
|
10675
11236
|
{
|
|
10676
11237
|
className: `px-4 py-2.5 text-sm font-medium border-b-2 ${activeTab === "footer" ? "border-gray-800 text-gray-800" : "border-transparent text-gray-500 hover:text-gray-700"}`,
|
|
@@ -10679,9 +11240,9 @@ function LayoutSettingsPage() {
|
|
|
10679
11240
|
}
|
|
10680
11241
|
)
|
|
10681
11242
|
] }) }),
|
|
10682
|
-
/* @__PURE__ */ (0,
|
|
10683
|
-
activeTab === "navbar" && /* @__PURE__ */ (0,
|
|
10684
|
-
activeTab === "footer" && footerMeta && /* @__PURE__ */ (0,
|
|
11243
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { className: "min-w-0 p-6", children: [
|
|
11244
|
+
activeTab === "navbar" && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(NavbarEditor, { config: navbarConfig, onChange: setNavbarConfig }),
|
|
11245
|
+
activeTab === "footer" && footerMeta && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
10685
11246
|
ComponentSettings,
|
|
10686
11247
|
{
|
|
10687
11248
|
meta: footerMeta,
|
|
@@ -10689,7 +11250,7 @@ function LayoutSettingsPage() {
|
|
|
10689
11250
|
onChange: (name, val) => setFooterValues((prev) => ({ ...prev, [name]: val }))
|
|
10690
11251
|
}
|
|
10691
11252
|
),
|
|
10692
|
-
activeTab === "footer" && !footerMeta && /* @__PURE__ */ (0,
|
|
11253
|
+
activeTab === "footer" && !footerMeta && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-sm text-gray-500", children: "No footer configuration defined in the current theme." })
|
|
10693
11254
|
] })
|
|
10694
11255
|
] });
|
|
10695
11256
|
}
|
|
@@ -10710,11 +11271,11 @@ var DEFAULT_ADMIN_NAV = [
|
|
|
10710
11271
|
var import_react49 = require("next-auth/react");
|
|
10711
11272
|
var import_next_themes = require("next-themes");
|
|
10712
11273
|
var import_sonner7 = require("sonner");
|
|
10713
|
-
var
|
|
11274
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
10714
11275
|
function CmsProviders({ children }) {
|
|
10715
|
-
return /* @__PURE__ */ (0,
|
|
11276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react49.SessionProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_next_themes.ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: [
|
|
10716
11277
|
children,
|
|
10717
|
-
/* @__PURE__ */ (0,
|
|
11278
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_sonner7.Toaster, { position: "top-right" })
|
|
10718
11279
|
] }) });
|
|
10719
11280
|
}
|
|
10720
11281
|
// Annotate the CommonJS export names for ESM import in node:
|